Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Robert Cummings
On Tue, 2007-07-31 at 11:29 -0400, Ken Tozier 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. F

Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Ken Tozier
On Jul 31, 2007, at 11:40 AM, Robin Vickery wrote: Or don't get numeric keys in the first place: foreach ($this->db->query($query, PDO::FETCH_ASSOC) as $row) Robin: Bingo! That did the trick. I knew my solution was hokey but I haven't used PDO before this project so wasn't aware of what i

Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Zoltán Németh
2007. 07. 31, kedd keltezéssel 11.29-kor Ken Tozier ezt írta: > 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 w

Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Robin Vickery
On 31/07/07, Ken Tozier <[EMAIL PROTECTED]> 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 examp

Re: [PHP] Unexpected values in an associative array[Solved]

2007-07-31 Thread Ken Tozier
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: foreach ($row as $key => $value) { if (