Re: PDO Prevent duplicate field names?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 2, 2012 at 5:38 PM, Scott Baker <bakers@xxxxxxxxxxxx> wrote:
> It was my mistake, and the SQL was easily fixed. But it woulda been nice
> to have PHP realize there was a dupe when it was building that array to
> return to me.

This is just not a province of PHP. What sort of behaviour would one
expect PHP to do given this scenario? It is surely not an error in
every case; I can see some code relying on this exact behaviour.
Making it some sort of option in PHP increases the complexity a great
deal, not only in trying to determine how to design and then *change*
the API to accommodate it, but in figuring out what exactly one might
*do*. Since SQL is a completely separate language from PHP, it makes
much more sense to learn to deal with these thing separately, and
understand what your SQL is doing. Indeed, SQL will happily return
multiple columns with the same column name; you must be aware of this
when writing it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux