pt_car_locations
Code: Select all
id pickup_location_id dropoff_location_id price
1 21 22 100
2 23 24 200
id location
21 Cappa
22 United
23 Mascut
24 ABCD
Hier muss ich den Abhol- und Abgabeort abrufen, indem ich beide Tabellen verbinde. Ich erläutere die Abfrage unten.
Code: Select all
$this->db->select('cl.pickup_location_id,cl.dropoff_location_id,cl.price,l.id,l.location');
$this->db->from('pt_car_locations as cl');
$this->db->join('pt_locations as l', 'cl.pickup_location_id = l.id', 'inner');
Mobile version