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



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
.



Relevant Pages

  • Re: Looking for keypad + LCD display with RS-232 link.
    ... Anybody know who manufactures a keypad with numeric keys with at least ... It should have a character display of at least 16 ...
    (comp.arch.embedded)
  • Re: Howmessy
    ... that is going to be in those keys and the impact of the data values. ... Numeric keys are not "hashed," per se. ... To join/leave the list, search archives, change list settings, * ...
    (comp.sys.hp.mpe)
  • Is numeric keys of Pythons dictionary automatically sorted?
    ... be a choice for bucket. ... found that if the keys are numeric, the keys themselves are ordered in the ... So I can just print out the contents of the dictionary in the desired order ... I also tried adding new numeric keys and found that the dictionary's keys ...
    (comp.lang.python)
  • sort keys issue
    ... I have a question about sorting the keys of a hash... ... I'm trying to sort the numeric keys in my ... parsed XML hash. ... Is there a way to force Perl to sort these keys numerically? ...
    (perl.beginners)
  • Re: hash keys
    ... > I am wondering if it is possible for me to have a hash with numeric keys ... > and a string as the value for each corresponding key. ... > The program below seems to populate the hash %jay with the correct values, ...
    (comp.lang.perl.misc)