SELECT SQL_CALC_FOUND_ROWS DISTINCT act.*,
GROUP_CONCAT(act.target_id) AS result_id
FROM blog_activity AS act
WHERE act.agent_id = AND type != 'photo'
GROUP BY act.type, act.group_id, DATE_FORMAT(time,'%Y-%m-%d')
ORDER BY time DESC
LIMIT 0, 2
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 'AND type != 'photo'
GROUP BY act.type, act.group' at line 4 SELECT *
FROM agent
WHERE 1 AND agent_id = LIMIT 1
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 'LIMIT 1' at line 3