good morning.
first clarify two things:
1. I am using a translator that can not speak English
2.I am using the codeigniter crud grocery.
I have this query with a join made ​​by active record:
$this->db->select('dp.nom_dpto');
$this->db->from('datos_factura df');
$this->db->join('establecimientos es','df.id_estab = es.id');
$this->db->join('ciudades ci','es.id_ciudad = ci.id_ciudad');
$this->db->join('dptos dp','ci.id_dpto = dp.id_dpto');
this, obviously, to bring a field in another table and display it in the table generated by the grocery crud.
but when I go to the browser, and I want to edit one of the records get this error:
Column 'id' in where clause is ambiguous
SELECT `dp`.`nom_dpto` FROM (`datos_factura` df, `datos_factura`) JOIN `establecimientos` es ON `df`.`id_estab` = `es`.`id` JOIN `ciudades` ci ON `es`.`id_ciudad` = `ci`.`id_ciudad` JOIN `dptos` dp ON `ci`.`id_dpto` = `dp`.`id_dpto` WHERE `id` = '15'
however, I discovered that this error is that after the WHERE in the following line: `id` = '15', you have to add the alias for the table that I am using words that would read: `df`.' id `= '15' then my real question is this:
How do I put that "alias" in id that is after the where?
take into account that, as I'm using codeigniter, this should be a process unlike any sql
thanks for your help