SQL Select * from multiple tables
- by zaf
Using PHP/PDO is it possible to use a wildcard for the columns when a select is done on multiple tables and the returned array keys are fully qualified to avoid column name clash?
example:
SELECT * from table1, table2;
gives:
Array keys are 'table1.id', 'table2.id', 'table1.name' etc.
I tried "SELECT table1.*,table2.* ..." but the returned array keys were not fully qualified so columns with the same name clashed and were overwritten.