[eluser]Berzacola[/eluser]
look, today i try to use this active record setting to get the oldest record for a slug in my table:
IT DOESNT WORK, IT GET THE FIRST ID... not the oldest one.
Code:
$query = $this->db->get_where('comments', array('slug' => $slug), 1, 'ORDER BY date ASC');
$pre = $query->result_array();
$id = $pre[0]['id'];
IT WORKS:
Code:
$this->db->select('id');
$this->db->where('slug',$slug);
$this->db->order_by('date','asc');
$query = $this->db->get('comments',1);
$pre = $query->result_array();
$id = $pre[0]['id'];
it is a bug?!