Re: php 5 and mysql failure



Caffeneide wrote:
On May 5, 2:13 pm, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:
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 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...@xxxxxxxxxxxxx
==================
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...@xxxxxxxxxxxxx
==================

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.
jstucklex@xxxxxxxxxxxxx
==================

.



Relevant Pages

  • Re: Speed up web pages : MySQL or PHP solutions ?
    ... People come to us to view 1 image or text + 1 PHP content. ... Can you click on the image = MYSQL ... Make your content cacheable by sending appropriate HTTP headers. ... Cache content on the server to avoid re-creation over and over again, ...
    (comp.lang.php)
  • Executing PHP files on remote web server
    ... We have a web app which uses PHP and MySQL on our in-house Apache web ... database to the web host because a lot of the data is sensitive. ... By loading the non-sensitive data into the web host's MySQL tables, ... running on our own web server. ...
    (comp.lang.php)
  • Re: Newbie Security Questions
    ... questions about PHP and its usage with MySQL. ... And even if they do, its a strange Mysql server that is sitting on the internet accepting requests from all and sundry..normally you run them on a local network, or the same box and set mysql to only accept requests FROM the apache server.. ... You have to layer that over the top using cookies and user logins if you want it. ...
    (comp.lang.php)
  • Re: Server load too high
    ... > the new dedicated server with Dual Xeon 3.2 GHz and 2GB Ram. ... > The board is written in PHP with Mysql. ... Well, since it looks like MySQL is eating more of the CPU, it could be ... In any case, I've been using PHP5 for a while now, and I've not ...
    (comp.lang.php)
  • Re: phpMyAdmin install help
    ... this means that PHP is lacking a certain functionality. ... talking to MySQL servers. ... It doesn't really matter where the MySQL server is running. ...
    (php.general)