PHP 4.0 Bug #2843: Cannot use variable after a mysql_fetch_array
| From: | yzhang at sfu dot ca | Date: | Sat, 27 Nov 1999 12:05:17 +0000 |
| Subject: | PHP 4.0 Bug #2843: Cannot use variable after a mysql_fetch_array | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-13171@lists.php.net to get a copy of this message | ||
From: yzhang@sfu.ca
Operating system: Linux
PHP version: 4.0 Beta 3
PHP Bug Type: Misbehaving function
Bug description: Cannot use variable after a mysql_fetch_array
Assuming $qid is a valid result of a mysql_query:
while ($r = mysql_fetch_array($qid)) {
...do something...
}
$r["foo"] = "bar";
echo $r["foo"];
Will not display anything. $r["foo"] is never assigned the value "bar".
Instead, I must forcefully unset($r); or $r = array; before trying to make the $r["foo"] =
assignment.
This works fine in PHP 3 but not in 4.0 beta 3.