PHP 4.0 Bug #3631: NULL data value not returned as in 3.x when using mysql_fetch_array/row
| From: | chris at digitaria dot com | Date: | Sat, 26 Feb 2000 02:32:33 +0000 |
| Subject: | PHP 4.0 Bug #3631: NULL data value not returned as in 3.x when using mysql_fetch_array/row | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16029@lists.php.net to get a copy of this message | ||
From: chris@digitaria.com
Operating system: NT 4.0 SP6a
PHP version: 4.0 Beta 4 Patch Level 1
PHP Bug Type: MySQL related
Bug description: NULL data value not returned as in 3.x when using mysql_fetch_array/row
Queries of the form
list($Parent, $CategoryName, $DBTemplate, $SortOrder) = mysql_fetch_array($catinfo);
no longer work (the exact same code with the exact same database does work with PHP 3.0.7).
I'll get an error such as
Warning: Undefined offset: 0 in D:\IIS\template-demo\index.php3 on line 88
This only happens when a query returns a NULL in one of the columns. Removing the NULL takes care of
this.
Switching to mysql_fetch_row still results in isset($row[0]) being false, requiring a change to
something unwieldy like (isset($foo[0]) ? $foo[0] : "NULL");