473,503 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php 5 and mysql failure

I'm using a php script which performs three xml queries to other three
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
Jun 2 '08 #1
10 1794
Caffeneide schreef:
I'm using a php script which performs three xml queries to other three
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
yes, there is..
http://tinyurl.com/3jgwjn

but, how many (or how much?) id's do get returned at max?
maybe you have to rewrite your solution to get a working one..

--
Luuk
Jun 2 '08 #2
Caffeneide wrote:
I'm using a php script which performs three xml queries to other three
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
It's possible you're running into a limit, but it's quite large.

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.
js*******@attglobal.net
==================

Jun 2 '08 #3
On Apr 30, 5:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Caffeneide wrote:
I'm using a php script which performs three xml queries to other three
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

It's possible you're running into a limit, but it's quite large.

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...@attglobal.net
==================
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
Jun 2 '08 #4
On Apr 30, 5:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Caffeneide wrote:
I'm using a php script which performs three xml queries to other three
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

It's possible you're running into a limit, but it's quite large.

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...@attglobal.net
==================
Probably it's a problem related to php and mysql. if I copy and paste
the query in phpmyadmin it always works, so I wouldn't say it's a
mysql limit problem.
Jun 2 '08 #5
On Mon, 05 May 2008 09:32:02 +0200, Caffeneide <mo****@gmail.comwrote:
On Apr 30, 5:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Caffeneide wrote:
I'm using a php script which performs three xml queries to other three
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

It's possible you're running into a limit, but it's quite large.

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.

thanks. the query is correct because only sometimes I got this
error...
I'd say: the (building of the) query is incorrect because sometimes you
get an error. How are you building it?
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
In the small hundreds should be a piece of cake for any database, so
that's probably not an issue. (Well, at least not on the MySQL side of
things).

And last but not least: when echoing out a query to check it's results
another way (phpMyAdmin, command line) always copy the _source_, and never
just what's in a browser window.
--
Rik Wasmus
Jun 2 '08 #6
Caffeneide wrote:
On Apr 30, 5:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Caffeneide wrote:
>>I'm using a php script which performs three xml queries to other three
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
It's possible you're running into a limit, but it's quite large.

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...@attglobal.net
==================

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.
js*******@attglobal.net
==================

Jun 2 '08 #7
Caffeneide wrote:
On Apr 30, 5:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Caffeneide wrote:
>>I'm using a php script which performs three xml queries to other three
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
It's possible you're running into a limit, but it's quite large.

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...@attglobal.net
==================

Probably it's a problem related to php and mysql. if I copy and paste
the query in phpmyadmin it always works, so I wouldn't say it's a
mysql limit problem.
Probably it's a problem in your code. If it were a problem related to
php and mysql, phpmyadmin would fail also - it is also php and mysql.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jun 2 '08 #8
On May 5, 2:13 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Caffeneide wrote:
On Apr 30, 5:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Caffeneide wrote:
I'm using a php script which performs three xml queries to other three
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
It's possible you're running into a limit, but it's quite large.
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...@attglobal.net
==================
Probably it's a problem related to php and mysql. if I copy and paste
the query in phpmyadmin it always works, so I wouldn't say it's a
mysql limit problem.

Probably it's a problem in your code. If it were a problem related to
php and mysql, phpmyadmin would fail also - it is also php and mysql.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Thank you Jerry, useful hint. This is the error logged: 2006: MySQL
server has gone away

Where has he gone? What can be the problem?
Jun 2 '08 #9
Caffeneide wrote:
On May 5, 2:13 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Caffeneide wrote:
>>On Apr 30, 5:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Caffeneide wrote:
I'm using a php script which performs three xml queries to other three
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
It's possible you're running into a limit, but it's quite large.
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...@attglobal.net
==================
Probably it's a problem related to php and mysql. if I copy and paste
the query in phpmyadmin it always works, so I wouldn't say it's a
mysql limit problem.
Probably it's a problem in your code. If it were a problem related to
php and mysql, phpmyadmin would fail also - it is also php and mysql.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

Thank you Jerry, useful hint. This is the error logged: 2006: MySQL
server has gone away

Where has he gone? What can be the problem?
OK, now we're making some progress. This is a MySQL failure, not one in
PHP (although your query may still have problems).

You need to follow this up on comp.databases.mysql (where I see you also
started a thread).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jun 2 '08 #10
On 5 Mag, 19:05, Jerry Stuckle <jstuck...@attglobal.netwrote:
Caffeneide wrote:
On May 5, 2:13 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Caffeneide wrote:
On Apr 30, 5:38 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Caffeneide wrote:
I'm using a php script which performs three xml queries to other three
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
It's possible you're running into a limit, but it's quite large.
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...@attglobal.net
==================
Probably it's a problem related to php and mysql. if I copy and paste
the query in phpmyadmin it always works, so I wouldn't say it's a
mysql limit problem.
Probably it's a problem in your code. If it were a problem related to
php and mysql, phpmyadmin would fail also - it is also php and mysql.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Thank you Jerry, useful hint. This is the error logged: 2006: MySQL
server has gone away
Where has he gone? What can be the problem?

OK, now we're making some progress. This is a MySQL failure, not one in
PHP (although your query may still have problems).

You need to follow this up on comp.databases.mysql (where I see you also
started a thread).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
thanks, it's seems I resolved this error increasing the value of MySQL
"wait_timeout" options...thank you!
Jun 2 '08 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3510
by: Lenz Grimmer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, MySQL 4.0.14, a new version of the popular Open Source/Free Software Database, has been released. It is now available in source and binary...
2
11111
by: AMD | last post by:
Hi, I would like to have MySQL use a mapped network drive. I'd like to do this in case there is a failure of the mysql machine, I can just replace it with a new machine pointing to the same...
0
1209
by: jwl | last post by:
I'm having a problem with a bit of code that I have "adopted". It was partially complete when I took it over. The function of the code is to read a log file, locate files described in that log...
5
3830
by: Ike | last post by:
Through Java, I am attempting to connect to a MySQL 4.12 server on a remote computer. I can connect fine via php. I cann connect fine via Java, through a servlet, when the servlet is on the same...
1
5259
by: PowerLifter1450 | last post by:
I've been having a very rough time installinig mySQL on Linux. I have been following the instructions form here: http://www.hostlibrary.com/installing_apache_mysql_php_on_linux Everytime I get to...
110
10441
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
7
3575
by: bylum | last post by:
Servlet SQLException Communication link failure java howto i can't connect jsp and database(mysql). This is the exception: exception org.apache.jasper.JasperException:...
3
5477
by: tulika dutta | last post by:
after 8 hrs my MySQL connection with JDBC gets time out. It gives the error java.sql.SQLException: No operations allowed after connection closed.Connection was implicitly closed due to underlying...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.