Hi guys...
I have this code:
$crud->set_relation_n_n('unitid', 'vehicles_vehicle_unit', 'vehicles_unit', 'vehicleid', 'unitid', 'unitid');
I can see table, but when i try edit or view I will have this error:
Column 'unitid' in field list is ambiguous
SELECT *, unitid as sb890403d FROM (`vehicles_vehicle_unit`) JOIN `vehicles_unit` ON `vehicles_vehicle_unit`.`unitid` = `vehicles_unit`.`unitid` WHERE `vehicleid` = '3506' ORDER BY `vehicles_unit`.`unitid`
The only way to resolve this problem is set table in Select, something like:
SELECT *, vehicles_unit.unitid as sb890403d FROM (`vehicles_vehicle_unit`) JOIN `vehicles_unit` ON `vehicles_vehicle_unit`.`unitid` = `vehicles_unit`.`unitid` WHERE `vehicleid` = '3506' ORDER BY `vehicles_unit`.`unitid`
It's possible fix this?