note 21926 added to function.mysql-fetch-array
| From: | barbieri at NOSPAMzero dot it | Date: | Fri, 31 May 2002 10:21:49 +0000 |
| Subject: | note 21926 added to function.mysql-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31269@lists.php.net to get a copy of this message | ||
Here is a suggestion to workaround the problem of NULL values:
// get associative array, with NULL values set
$record = mysql_fetch_array($queryID,MYSQL_ASSOC);
// set number indices
if(is_array($record))
{
$i = 0;
foreach($record as $element)
$record[$i++] = $element;
}
This way you can access $result array as usual, having NULL fields set.
--
http://www.php.net/manual/en/function.mysql-fetch-array.php
http://master.php.net/manage/user-notes.php?action=edit+21926
http://master.php.net/manage/user-notes.php?action=delete+21926
http://master.php.net/manage/user-notes.php?action=reject+21926