Reputation: 41
I have two tables:
Table procedures has two columns
Table countries
Im trying to join up the two tables in order to get both destination an origin country name from countries table.
SELECT *
FROM draft_procedures AS drp
LEFT JOIN countries AS c1 ON drp.destination_country_iso = c1.iso
LEFT JOIN countries AS c2 ON drp.origin_country_iso = c2.iso
The SQL result display proper result, but I now have two duplicate columns "name" and Im unable to retrieve them with the php code:
$destination_country=$row['c1.name'];
Upvotes: 1
Views: 34
Reputation: 4370
access it like this
SELECT drp.*,c1.name as c1name,c2.name as c2name
then
$row['c1name'] $row['c2name']
Upvotes: 2