SELECT `clubs`.`ClubID`, `clubs`.`ClubName`, `clubs`.`PrefClubName`, `pages`.`ClubID`, `pages`.`MemOnly`, `pages`.`PgID`,`pages`.`MODisplay`,`pages`.`PgTypeID`, `pages`.`PgTitle`, DATE_FORMAT (pages.StartDate,'%H.%i') AS EvStartTime, DATE_FORMAT (pages.StartDate,'%a %D %M %Y') AS `StartDate`, if (DATE_FORMAT (pages.StartDate,'%H.%i')= '00.00',`clubs`.`MeetTime`, DATE_FORMAT (pages.StartDate,'%H.%i')) AS StartTime, `pages`.`PgBriefDetails`, DATE_FORMAT (pages.EndDate,'%a %D %M %Y') AS `EndDate`, if (DATE_FORMAT (pages.EndDate,'%H.%i')= '00.00','',DATE_FORMAT (pages.EndDate,'%H.%i')) AS EndTime, `pages`.`PgMainPic`, `pages`.`PgMainPicAltText`, CHAR_LENGTH (PgDesc ) AS `MoreCount` FROM `clubs` Inner Join `clubs` AS `clubsarea` ON `clubsarea`.`DistAreaID` = `clubs`.`DistAreaID` Inner Join `pages` ON `clubs`.`ClubID` = `pages`.`ClubID` WHERE (`clubsarea`.`ClubID` = ?) AND pages.ClubID <> ? AND (StartDate >=CURDATE()) AND (`pages`.`Active` = '1') AND DisplayDistricts='1' AND (`pages`.`MemOnly` = 0) AND pages.PgTypeID = '2' AND (`pages`.`DisplayUntil` > now() OR `pages`.`DisplayUntil` IS NULL ) ORDER BY pages.StartDate ASC

FUNCTION rotaryri_ribit.DATE_FORMAT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
There is an error in your SQL syntax. 215 WA_MySQLi_RS