SELECT a.id_comment AS `a.id_object`,a.id_user AS `a.id_user`,a.id_reply AS `a.id_reply`,a.id_location AS `a.id_location`,a.location AS `a.location`,a.name AS `a.name`,a.date AS `a.date`,a.text AS `a.text`,a.plus AS `a.plus`,a.minus AS `a.minus` FROM new_comment AS a WHERE id_location= AND location='fun_video' ORDER BY date ASCYou 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 location='fun_video' ORDER BY date ASC' at line 1SELECT SUM(plus) AS `plus`, SUM(minus) AS `minus`, id_user FROM new_comment WHERE id_user IN ( SELECT id_user FROM new_comment WHERE id_location= AND location='fun_video') GROUP BY id_userYou 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 location='fun_video') GROUP BY id_user' at line 2