note 18099 added to function.mysql-fetch-array
| From: | some at gamepoint dot net | Date: | Thu, 10 Jan 2002 16:13:44 +0000 |
| Subject: | note 18099 added to function.mysql-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24623@lists.php.net to get a copy of this message | ||
I never had so much trouble with null fields but it's to my understanding that extract only
works as expected when using an associative array only, which is the case with mysql_fetch_assoc()
as used in the previous note.
However a mysql_fetch_array will return field values with both the numerical and associative keys,
the numerical ones being those extract() can't handle very well.
You can prevent that by calling mysql_fetch_array($result,MYSQL_ASSOC) which will return the same
result as mysql_fetch_assoc and is extract() friendly.
--
http://www.php.net/manual/en/function.mysql-fetch-array.php
http://master.php.net/manage/user-notes.php?action=edit+18099
http://master.php.net/manage/user-notes.php?action=delete+18099
http://master.php.net/manage/user-notes.php?action=reject+18099