ID:               25627
 Updated by:       [EMAIL PROTECTED]
 Reported By:      MDonatas at centras dot lt
-Status:           Open
+Status:           Bogus
 Bug Type:         MySQL related
 Operating System: Windows XP
 PHP Version:      4.3.3
 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

You are supposed to provide correct arguments to the function. If they
query has failed you should return value then, not pass it to another
function.


Previous Comments:
------------------------------------------------------------------------

[2003-09-22 09:00:56] MDonatas at centras dot lt

Description:
------------
In documentation for mysql_fetch_array (); it says "Returns an array
that corresponds to the fetched row, or FALSE if there are no more
rows."

But if connection to database fails or querie is somewhat wrong, this
function will return NULL which is defenitely wrong.

if you have script like

while (FALSE !== ($info = mysql_fetch_array ($result)))
{
  ...
}

then it will start infinite loop.

Reproduce code:
---------------
<?
  //WARNING! This will start infinite loop
  
  while (FALSE !== ($info = mysql_fetch_array ($result)))
  {
  }
?>

Expected result:
----------------
Should return FALSE on any failures

Actual result:
--------------
Returns NULL on failures.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25627&edit=1

Reply via email to