php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3631 NULL data value not returned as in 3.x when using mysql_fetch_array/row
Submitted: 2000-02-25 21:32 UTC Modified: 2000-05-22 09:35 UTC
From: chris at digitaria dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0 Beta 4 Patch Level 1 OS: NT 4.0 SP6a
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chris at digitaria dot com
New email:
PHP Version: OS:

 

 [2000-02-25 21:32 UTC] chris at digitaria dot com
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");


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-22 09:35 UTC] andrei at cvs dot php dot net
NULLs are now returned in query results.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 02:01:32 2025 UTC