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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: drfickle at us dot ibm dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 01:01:30 2025 UTC