Qrong query!: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'toupcam.gallery.file' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
SELECT items.`id`, gallery.`file` FROM `a_items` AS items
LEFT JOIN `a_gallery` AS gallery ON gallery.`parent` = items.`id`
WHERE gallery.`id` IS NOT NULL AND items.`price`<>'0' AND items.`instock`='enabled' AND items.`status`='enabled' GROUP BY items.`id` LIMIT 50