Expression #10 of SELECT list is not in GROUP BY clause and contains nonaggregated column '' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by | php_file_tree.php | SELECT dtw_webpages.*, dtw_webpages.webkey_id, dtw_webkeys.webkey, AS cid, dtw_content.the_order FROM dtw_webpages inner join dtw_webkeys on dtw_webpages.webkey_id= INNER join dtw_content on dtw_content.webpage_id WHERE dtw_webpages.parent= '1' AND show_in_menu='1' AND dtw_content.the_order= '1' GROUP BY order by menu_order, dtw_content.the_order