php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12799 mysql_fetch_array returns good data even if resource identifier is bad
Submitted: 2001-08-16 15:35 UTC Modified: 2001-12-14 13:57 UTC
From: drfickle at us dot ibm dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.6 OS: Mandrake Linux
Private report: No CVE-ID: None
 [2001-08-16 15:35 UTC] drfickle at us dot ibm dot com
When calling mysql_fetch_array($foo) and $foo is not a valid resource identifier (not even a defined variable), the function call will return data from the last successful query instead erroring. 

This makes it very difficult to debug your code because you may return data from a different query. Instead the function should return nothing so that you know to look at your function call arguments.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-20 19:07 UTC] mfischer@php.net
Can't reproduce with RC3, please test it too:

http://www.php.net/~zeev/php-4.1.0RC3.tar.gz

Feedback.
 [2001-12-13 06:26 UTC] sander@php.net
No feedback. Closing.
 [2001-12-14 13:57 UTC] drfickle at us dot ibm dot com
Sorry it didn't get to this in a timely fashion. I have just verified it with 4.1.0 final and it works properly. Thank you much.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 17:01:29 2024 UTC