I have this query right now to grab comments on my website:
ul.username as username_edited
FROM `articles_comments` a
LEFT JOIN `users` u ON a.author_id = u.user_id
LEFT JOIN `users` ul ON ul.user_id = a.last_edited
WHERE a.`article_id` = ? ORDER BY a.`comment_id` ASC LIMIT ?
Syntax error or access violation: 1140 In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'goltest.a.author_id'; this is incompatible with sql_mode=only_full_group_by
The error message tells you what's wrong: You need to
group by something, to count how many likes that something has. The grouping is usually done on the primary key on which you're joining the tables.