Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'hostpapa_yogpathy.gallery.gallery_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_bySelect * from `gallery`,`gallery_category` where `gallery_category`.`category_id` = `gallery`.`category_id` and gallery.is_active ='1' group by gallery.category_id order by `gallery_category`.`set_order` asc LIMIT 0, 9