Mislukt: SELECT r1.id,r1.profielID,r1.beschrijving,r1.aanmaakdatum,TIME_TO_SEC(TIMEDIFF(NOW(),r1.aanmaakdatum)+0)/60 AS minuten, COUNT(r2.id) AS aantal FROM tblreactie r1 LEFT JOIN tblreactie r2 ON r2.reactieID=r1.id WHERE r1.postID= AND r1.reactieID=0 AND r1.status=0 GROUP BY r1.id ORDER BY aanmaakdatum DESC LIMIT 3,20 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND r1.reactieID=0 AND r1.status=0 GROUP BY r1.id ORDER BY aanmaakdatum DESC LIM' at line 1