Select tblEvents.EventID AS PageID,tblEvents.EventID AS ParentID,tblEvents.ClickCount,tblPageTemplate.* from tblEvents,tblPageTemplate,tblStatus Where tblEvents.EventID=index AND tblEvents.PageTemplateID=tblPageTemplate.PageTemplateID AND tblEvents.StatusID=tblStatus.StatusID AND tblStatus.DisplayOnSite=1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index AND tblEvents.PageTemplateID=tblPageTemplate.PageTemplate