SELECT COUNT(*) AS anzahl FROM content WHERE vonUserId=21 AND (access <= 0 OR vonUserID = ) AND beitragsart = 'userbild' -> 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 ') AND beitragsart = 'userbild'' at line 1