MySQL Error 1064: 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 'GROUP BY p.prKey ORDER BY isPublished' at line 1 query=SELECT p.prKey, p.isPublished,gpName domain, gpKey , prName, u.usKey, usFirstName, usLastName, COUNT(d.prKey) connections, DATE_FORMAT(prDate, '%b %e, %y') prFormatDate FROM principle p, users u, groups grp LEFT JOIN connection d ON p.prKey = d.prKey WHERE grp.gpKey = p.prPubGrp AND p.prLevel != 3 AND p.prUser = u.usKey AND p.prPubGrp = GROUP BY p.prKey ORDER BY isPublished URL=/dp/managePrinciples.php?PHPSESSID=2cf6064d95fec07fea2c089837668bd1