Re: PDO question: any way to resolve duplicate column names with PDO_FETCH_ASSOC?

From: Date: Mon, 13 Jun 2005 21:38:13 +0000
Subject: Re: PDO question: any way to resolve duplicate column names with PDO_FETCH_ASSOC?
References: 1 2 3 4  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-2470@lists.php.net to get a copy of this message
Wez Furlong wrote:
What you propose when the underlying library supports returning table names - adding an attribute on the prepare - would be fine. I wondered why you wouldn't want to put it on the fetch, like PDO_FETCH_ASSOC_QUALIFIED, but maybe it's extra work to collect the information in the first place?
Yes
IIRC the php SQLite ext always uses the table+column name unless you specifically alias. i presume that the pdo ext will behave in the same way. whatever magic, i feel the only really safe way is to use aliasing to get disjunct column names from the database itself when doing associative fetches. whats nasty is that aliasing doesnt work the same on all rdbms according to daniel: http://www.analysisandsolutions.com/presentations/portability/slides/as.htm regards, Lukas

« previous php.pecl.dev (#2470) next »