group_concat query outputs no $result and no errors

I am pretty sure this is an easy one, but I am lost and blind.

the query that works:


$result = mysqli_query($link, 'SELECT events.*, filestore.filename
FROM events
LEFT JOIN filestore ON events.id = filestore.event_id 
ORDER BY events.startdate ASC LIMIT 0 , 30 ');

this outputs a row for every file, and outputs events for which no files are associated, almost what I want.

the query that doesn’t work :


$result = mysqli_query($link, 'SELECT events.*, GROUP_CONCAT(filestore.filename SEPARATOR '  ') as filenames FROM events 
LEFT JOIN filestore ON events.id = filestore.event_id GROUP BY events.id ORDER BY events.startdate ASC
LIMIT 0 , 30 ');

This one works with PMA, returning one row for each event, even if no files for that event are in the db, with filenames concatenated in one field - but I never get a $result output from var_dump and weirdly am not getting an error from


if (!$result)
{
	$error = 'Error fetching events: ' . mysqli_error($link);
	include 'error.html.php';
	exit();
}

Because the query I want to use works in mysql/PMA - I am posting in PHP

thanks

I was using single quotes for the group_concat function separator param inside single quotes for the whole query string.

I sure feel like deleting this thread! :eye: