Re: Unexpected values in an associative array[Solved]

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

 



On 31/07/07, Ken Tozier <kentozier@xxxxxxxxxxx> wrote:
> Turns out that objects returned from SQL queries contain two parts
> for every field, one with a string key and one with an index key.
> Adding an "is_numeric" test on the keys allows you to filter out the
> numeric keys if you want to. For example:

Or don't get numeric keys in the first place:

foreach ($this->db->query($query, PDO::FETCH_ASSOC) as $row)

-robin

-- 
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