Reply to Re: $result = $stmnt->fetchAll(); returning duplicate keys for a single query

Your name:

Reply:


Posted by Rowan on 01/11/08 18:57

On Jan 11, 10:21 am, Rowan <yaard...@gmail.com> wrote:
> For some reason when I do a fetchall on a PDO query the array returned
> has duplicated keys. see below.
>
> SELECT name_first, name_last, personal_street, personal_phone_home,
> personal_phone_cell FROM contacts WHERE id = 8;
> $result = $stmnt->fetchAll();
>

Helps when you read. For anyone curious the answer is below.

Controls how the next row will be returned to the caller. This value
must be one of the PDO::FETCH_* constants, defaulting to
PDO::FETCH_BOTH.

*

PDO::FETCH_ASSOC: returns an array indexed by column name as
returned in your result set
*

PDO::FETCH_BOTH (default): returns an array indexed by both
column name and 0-indexed column number as returned in your result set

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация