php - MySQL join tables and get values that have the same key name -
i trying select of address id's 1 table , join attributes other tables. need join values on tables , c entity_id since tables have same key "value" second join replacing value of first.
what doing wrong here?
$query = "select a.parent_id, b.value, c.value customer_address_entity left join customer_address_entity_varchar b on a.entity_id = b.entity_id left join customer_address_entity_text c on a.entity_id = c.entity_id limit 100"; var_dump($query); but array of 4. a.value being overwritten c.value
array (size=4) 'parent_id' => string '7' (length=1) 'entity_id' => string '6' (length=1) 'value' => string '19 standiford ct' (length=16) 'attribute_id' => string '25' (length=2)
perhaps alias 1 column give unique name? i.e.
$query = "select a.parent_id, b.value, c.value foobar customer_address_entity left join customer_address_entity_varchar b on a.entity_id = b.entity_id left join customer_address_entity_text c on a.entity_id = c.entity_id limit 100"; ... edit: there other ways of doing this, helpful me see example data , possibly code processing of results.
Comments
Post a Comment