Re: php 5 and mysql failure
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Mon, 05 May 2008 08:11:46 -0400
Caffeneide wrote:
On Apr 30, 5:38 pm, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:Caffeneide wrote:I'm using a php script which performs three xml queries to other threeIt's possible you're running into a limit, but it's quite large.
servers to retrieve a set of ids and after I do a query to mysql of
the kind
SELECT * FROM table WHERE id IN ('set of ids');
Although I'm sure the connection to the database is ok, I sometimes
get an error of this kind:
*Warning*: mysql_fetch_object(): supplied argument is not a valid
MySQL result resource in ...
This does not happen every time i run the script, only sometimes.
If I echo the query, copy and paste in phpmyadmin, or if I perform the
same query in a script that does only the query without the rest it
works!
After troubleshooting this issue I noticed that it usually failed when
I had a big set of ids (positive response from more than one server).
This means that the script used a bigger amount of memory and probably
more resources, but I did not get an "out of memory error", I got the
one described before.
My question is, is there any kind of limit somewhere in php5 or in
mysql (version 5)?
Thanks for help,
YEHUDI GARRETT
The "supplied argument is not a valid MySQL result resource" indicates
your mysql_query() returned false, probably. You should ALWAYS check
the result of mysql_query(), and if it fails, log the error (you really
don't want to display those errors to your users, do you?). Or, on a
development system, display the error.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@xxxxxxxxxxxxx
==================
thanks. the query is correct because only sometimes I got this
error...but the way on which I got this error seems to be completely
random...the number of ids I returned is quite variable but it's
around some (one-two-three) hundreds
If the query were correct, you would not be getting the error you are getting.
Your error indicates mysql_query() returned false. It did not return zero entries; that is still a result resource (albeit an empty one).
ALWAYS check the result of mysql_query(). And when it returns false, try logging the error returned by mysql_error(). It also may help to log the SELECT statement itself.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- Re: php 5 and mysql failure
- From: Caffeneide
- Re: php 5 and mysql failure
- Prev by Date: Re: Sessions
- Next by Date: Re: php 5 and mysql failure
- Previous by thread: Re: php 5 and mysql failure
- Next by thread: Re: php 5 and mysql failure
- Index(es):
Relevant Pages
|