Edit report at https://bugs.php.net/bug.php?id=60251&edit=1

 ID:                 60251
 Updated by:         johan...@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

Reply via email to