php - Getting two values from same Joined table -


i have 2 tables:

  • procedures
  • countries

table procedures has 2 columns

  1. destination_country_iso
  2. origin_country_iso

table countries

  1. iso
  2. name

im trying join 2 tables in order both destination origin country name countries table.

select * draft_procedures drp left join countries c1 on drp.destination_country_iso = c1.iso left join countries c2 on drp.origin_country_iso = c2.iso 

the sql result display proper result, have 2 duplicate columns "name" , im unable retrieve them php code:

$destination_country=$row['c1.name'];  

access this

select drp.*,c1.name c1name,c2.name c2name $row['c1name'] $row['c2name'] 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -