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 '' at line 6 (SELECT art_id, art_accesari FROM articole WHERE 1 AND art_accesari>1 ORDER BY art_accesari DESC LIMIT )