Bug #51400 [NEW]: mysql_fetch_array() returns NULL
| From: | aa at marcandi dot com | Date: | Fri, 26 Mar 2010 13:56:18 +0000 |
| Subject: | Bug #51400 [NEW]: mysql_fetch_array() returns NULL | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-149060@lists.php.net to get a copy of this message | ||
From:
Operating system: CentOS 5.2 (64-bit)
PHP version: 5.3.2
Package: MySQL related
Bug Type: Bug
Bug description:mysql_fetch_array() returns NULL
Description:
------------
Calling mysql_fetch_array() with an empty/errorneous result set returns
NULL, not
FALSE. This is a behavioral change from 5.2.10.
Documentation says: "Returns an array of strings that corresponds to the
fetched
row, or FALSE if there are no more rows."
Test script:
---------------
$r = @mysql_query( 'This is a broken query' );
$f = @mysql_fetch_array( $r );
print var_dump( $f );
Expected result:
----------------
FALSE
Actual result:
--------------
NULL
--
Edit bug report at http://bugs.php.net/bug.php?id=51400&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51400&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51400&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51400&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51400&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51400&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51400&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51400&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51400&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51400&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51400&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51400&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51400&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51400&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51400&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51400&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51400&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51400&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51400&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51400&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51400&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51400&r=mysqlcfg