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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 19:01:33 2024 UTC