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 'ORDER BY c.dateline DESC LIMIT 0, 6' at line 1 SELECT u.id,u.username,u.nickname,u.follows,u.fans,u.headimage,(SELECT id FROM user_concerns WHERE userid = 0 AND concern_userid = u.id) AS is_follow FROM users AS u LEFT JOIN user_concerns AS c ON u.id = c.userid WHERE c.concern_userid = ORDER BY c.dateline DESC LIMIT 0, 6