Bug #60251 [Opn->Bgs]: mysql_fetch_row bad return value on error
| From: | johannes@php.net | Date: | Thu, 10 Nov 2011 18:07:52 +0000 |
| Subject: | Bug #60251 [Opn->Bgs]: mysql_fetch_row bad return value on error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165014@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60251&edit=1
ID: 60251
Updated by: johannes@php.net
Reported by: richard dot gavenda at gmail dot com
Summary: mysql_fetch_row bad return value on error
-Status: Open
+Status: Bogus
Type: Bug
Package: MySQL related
Operating System: Windows
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
See note in http://php.net/functions.internal
Previous Comments:
------------------------------------------------------------------------
[2011-11-09 15:03:30] richard dot gavenda at gmail dot com
Description:
------------
When $result parameter of mysql_fetch_row isn't resource, mysql_fetch_row returns NULL instead
of FALSE.
This code:
while (($data = mysql_fetch_row($result)) !== false) {
...
}
gets in infinite loop
Test script:
---------------
$result = mysql_query("BAD SQL SYNTAX OR CONNECTION PROBLEM");
// $result value is now FALSE
$data = mysql_fetch_row($result);
var_dump($data);
Expected result:
----------------
bool(false)
Actual result:
--------------
NULL
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60251&edit=1