#29633 [NEW]: Result Resource Deleted, valid for first fetch, then becomes invalid
| From: | paul at campbell-multimedia dot co dot uk | Date: | Thu, 12 Aug 2004 14:19:14 +0000 |
| Subject: | #29633 [NEW]: Result Resource Deleted, valid for first fetch, then becomes invalid | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-64493@lists.php.net to get a copy of this message | ||
From: paul at campbell-multimedia dot co dot uk
Operating system: Linux redhat i386
PHP version: 4.3.8
PHP Bug Type: MySQL related
Bug description: Result Resource Deleted, valid for first fetch, then becomes invalid
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.
--
Edit bug report at http://bugs.php.net/?id=29633&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29633&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29633&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29633&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29633&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29633&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29633&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29633&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29633&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29633&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29633&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29633&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29633&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29633&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29633&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29633&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29633&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29633&r=float