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 ( `p`.`situationtype`='3' ) GROUP BY `p`.`id` ORDER BY `p`.`city` AS' at line 1 | SELECT `p`.`id` , `p`.`txtonbrpers` , `p`.`city` , '0' AS `islog` FROM `publications` AS `p` LEFT JOIN `publications_dispos` AS `pd` ON `p`.`id`=`pd`.`idpublication` WHERE `p`.`idsession`='' AND `p`.`status` ='1' AND `p`.`publishdate`<>'0000-00-00 00:00:00' AND `p`.`validdate` >= '2012-02-12' AND ( `p`.`idcountry`='4' ) AND ( ) AND ( `p`.`situationtype`='3' ) GROUP BY `p`.`id` ORDER BY `p`.`city` ASC limit 0,300