Unable to get data 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 'grouping g, entry e WHERE g.compid = c.id AND e.grouping' at line 8
SELECT p.id AS person_id, p.name, g.name AS course, e.time, c.map, c.id AS event_id, UPPER(e.class) AS class, IF(INSTR(LOWER(p.club),"object") = 0 && LOWER(p.club) <> "non member" && LOWER(p.club) <> "none" && LOWER(p.club) <> "no club" ,p.club,"") AS club #FROM person p LEFT OUTER JOIN siarchive s ON CONCAT(s.firstname," ",s.surname) = p.name, FROM person p, competition c, grouping g, entry e WHERE g.compid = c.id AND e.groupingid = g.id AND e.competitorid = p.id AND (c.league LIKE "%Leinster League%") AND e.time <> "DNF" AND e.time <> "0" #in case DNFs dont get inputted properly AND e.pos > 0 #exclude DNFs and NCs #AND g.name = "Green" #AND c.map = "Brockagh" AND c.cdate > "2017-01-01" AND c.cdate < "2018-01-31" AND g.exclude <> 1 ORDER BY g.name, p.name, c.map