I want to select distinct values from a database table using CodeIgniter, but it returns duplicate values. Could you please check what is wrong with my code below?
$this->db->distinct('country');
$this->db->where('id', $id);
$query = $this->db->get('table_name');
can try like this?
$this->db->distinct();
$this->db->select('country');