SELECT tbl_mobileoverig.* FROM tbl_mobileoverig WHERE tbl_mobileoverig.hoofdthema = 'Foto's Griekenland' and tbl_mobileoverig.parameter5 <> 'fotowedstrijd-april-2003-2' and tbl_mobileoverig.fotoklein <> '' ORDER BY rand()

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 's Griekenland' and tbl_mobileoverig.parameter5 <> 'fotowedstrijd-april-2003-2' a' at line 1