Error: 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 ') AS Totaal FROM INNER JOIN foto ON .FotoID = foto.ID WHERE `status`='1'' at line 1 Query:SELECT COUNT(DISTINCT .Id) AS Totaal FROM INNER JOIN foto ON .FotoID = foto.ID WHERE `status`='1'