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=7c2c3ab064523a56ef9e7939eac75c07