Non aggregated Column with Count

I am very new to MySQL, I am trying to make an events page that counts and displays likes. I get the error:

Error details: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #10 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'db.events_likes.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

I cannot change SQL mode, so I was wondering if there was a way to aggregate the column?

code:

SELECT  *, eventid, COUNT(events_likes.id) AS likes, GROUP_CONCAT(users.fname SEPARATOR '|') AS liked_by FROM  events
     LEFT JOIN events_likes 
     ON events.eventid = events_likes.event

     LEFT JOIN users
     ON events_likes.user = users.id
     GROUP BY events.eventid
     

Answer

The issue is with the * in SELECT *

You’re asking MySQL to return each column in the target tables, but some of them are not aggregated (event_likes.id).

List ONLY the columns you need.

SELECT  eventid, COUNT(events_likes.id) AS likes, GROUP_CONCAT(users.fname SEPARATOR '|') AS liked_by FROM  events
 LEFT JOIN events_likes 
 ON events.eventid = events_likes.event

 LEFT JOIN users
 ON events_likes.user = users.id
 GROUP BY events.eventid