note 13631 added to function.mysql-fetch-array.php
| From: | php-general at lists dot php dot net | Date: | Mon, 25 Jun 2001 14:54:06 +0000 |
| Subject: | note 13631 added to function.mysql-fetch-array.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14635@lists.php.net to get a copy of this message | ||
actually with php 4.0.5 mysql_fetch_assoc DOES set NULL fields, so you can safely overwrite existing
values with
$result = mysql_query($some_query);
while($row=mysql_fetch_assoc($result)){
extract($row);
// ...
}
extract will do the job of walking through the associative array and setting the variables $$key to
$value for you even when $value is NULL
mysql_fetch_row also consistently retrieves NULL values with the correct indices
Ivan
http://www.php.net/manual/en/function.mysql-fetch-array.php