Error in query: SELECT trader.*,municipality.name_en as municipality_name,region.name_en as region_name FROM trader LEFT JOIN municipality ON municipality.municipality_id=trader.municipality LEFT JOIN region ON region.region_id=municipality.region_id WHERE blocked='0' AND verified='1' AND id=. 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 5