1
只是想使用codeigniter從db中選擇不同的值,但它會返回重複的值。請問我的代碼如下:不能使用codeigniter選擇不同的值
$this->db->distinct('country');
$this->db->where('id',$id);
$query = $this->db->get('table_name');
只是想使用codeigniter從db中選擇不同的值,但它會返回重複的值。請問我的代碼如下:不能使用codeigniter選擇不同的值
$this->db->distinct('country');
$this->db->where('id',$id);
$query = $this->db->get('table_name');
可以試試這個嗎?
$this->db->distinct();
$this->db->select('country');
太好了,謝謝! :) – EducateYourself 2014-09-03 13:12:11
接受答案將感謝她更多! ;) – 2014-09-03 13:24:57