php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29633 Result Resource Deleted, valid for first fetch, then becomes invalid
Submitted: 2004-08-12 16:18 UTC Modified: 2004-08-24 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: paul at campbell-multimedia dot co dot uk Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 4.3.8 OS: Linux redhat i386
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-08-12 16:18 UTC] paul at campbell-multimedia dot co dot uk
Description:
------------
I can't post a short script that creates this problem as  
it appears to be illusive.  
  
I have an DB abstraction class that I have used on  
everysite I have done for the last 3 years and it works on  
every site.  
  
The problem presents itself as an invalid result resource,  
eg.  "8 is not a valid MySQL result resource in  
generic.php line 230"  
  
The code queries a table for 20 "ids", then for each ID it  
loads an object instance variables using a sepearte query,  
then it queries 3 other tables for related info and  
finally prints out a table of info and moves on to the  
next row in the original query.  
  
When it gets to the next row the result resource is no  
longer valid.   
  
The code worked perfectly until the host upgraded, nothing  
has been changed in the last year.  If I download the code  
and run it on my server (PHP 4.3.6) it works perfectly.  
  
Worse still is that other very similar areas of the site,  
using subclasses of the same object code that produces the  
error, work perfectly.  To be clearer, 2 subclasses of a  
ProfileList do very similar things, the both use the same  
code to render themselves.  One fails, the others work.   
even thought they are the same peices of code, the same  
tables and the only difference is in the original query.  
  
The failing query is,   
"SELECT id FROM designers LIMIT 0,20"  
  
I have check again and again that the result is NOT being  
overwritten and it is #8 when the first row is returned  
and is is STILL #8 when the next row is fetched, yet the  
second attempt to fetch returns the invalid result error.  
  
Has the number of active result resources been decreased  
in 4.3.8?  
  
Thanks.  


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-12 16:25 UTC] paul at campbell-multimedia dot co dot uk
I can if required post, or email the developers the 
complete code files and the URL to the live site. 
 
Further to my post I have found that google.com has 
spidered sites in the past few months with the exact same 
error, some sites have fixed the problem, others haven't.   
 
I also found several references to people with the same 
illusive problem after upgrading from 4.3.7 to 4.3.8, but 
alas, no solutions.
 [2004-08-17 00:21 UTC] iliaa@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.


 [2004-08-24 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Nov 28 23:03:13 2021 UTC