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 1select t1.*, t2.*,t2.id as idcountry, t1.id as id, t3.* from users t1 join countrylist t2 on t1.id_country=t2.id join auth_user t3 on t1.auth_user_id=t3.user_id where t1.id=