Reply to Re: An extra last empty field in an 'mysql_fetch_array' result array?

Your name:

Reply:


Posted by Peter van Schie on 10/14/05 01:06

Marcel Brekelmans wrote:
> The following code:
>
> $oCursor = mysql_query("SELECT ID from tblName WHERE Name='Jane'");
> if (!$oCursor)
> {
> $bGo = false;
> }
> else
> {
> $aRow = mysql_fetch_array($oCursor);
> }
>
> results in:
>
> count($aRow) = 2;
>
> $aRow[0] = 1;
> $aRow[1] = '';

Marcel,

mysql_fetch_array by default fetches the result both as an associative
array and a numeric array. It has two parameters, the second parameter
is either MYSQL_ASSOC, MYSQL_NUM or MYSQL_BOTH, default is MYSQL_BOTH.
Doing a print_r($aRow) will show this too.

HTH.
Peter.
--
http://www.phpforums.nl

[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

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