Re: [PHP-DB] PDO include table name prefixes in FETCH_ASSOC

2010-03-24 Thread Aaron Paetznick
Thanks for the advise. I wanted a more automatic method of prefixing column names, but I ended up just aliasing them all. I know I could always just issue multiple SELECTs, but I wish MySQL would support this sort of functionality natively. I'd really like to reference my results as $result[

[PHP-DB] PDO include table name prefixes in FETCH_ASSOC

2010-03-24 Thread Aaron Paetznick
Many of my MySQL tables have columns with the same name. I want to have PDO include table names in named result sets. For example: $sth = $dbh->prepare("SELECT * FROM table0, table1"); $result = $sth->fetchAll(PDO::FETCH_ASSOC); I want $result to be organized like: echo $result["table