I use CodeIgniter for my project and this is my code in model
public function group_all_ville(){
$this->db->select('*');
$this->db->from('departement');
$this->db->join('villes', 'villes.num_dept = departement.num_dept');
$this->db->group_by('nom_dept');
$query = $this->db->get();
return $query->result();
}
and this is error after execution
A Database Error Occurred
Error Number: 1055
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'pneu.departement.id_dept' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
SELECT * FROM `departement` JOIN `villes` ON `villes`.`num_dept` = `departement`.`num_dept` GROUP BY `nom_dept`
Filename: C:/wamp64/www/pneu/system/database/DB_driver.php
Line Number: 691
I try different method but nothing result. Thanks