[eluser]CARP[/eluser]
Hi...
I'm building some sort of catalog.
I have a category table, which has
id - autoinc
name - varchar(100)
desc - tinytext
fk_cat - int(10) foreign key that points to category.id (self reference foreign key)
Of course, I can't execute the following code..
Code:
$this->db->select('*');
$this->db->from('category');
$this->db->join('category', 'category.id = category.fk_id', 'left');
$this->db->order_by('category.name', 'asc');
$query = $this->db->get();
becase I'm getting the following error
Error Number: 1066
Not unique table/alias: 'category'
It seems there's no way to give alias to each table in Active Record calls, right? Any workaround?
Thanks a lot in advance,