By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,706 Members | 2,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,706 IT Pros & Developers. It's quick & easy.

Lost connection with stored procedures and PHP

P: n/a
I'm using stored procedures in a PHP site, with mysql. I'm having problems
with stored procedures. Of the two I'm using, one works all the time, consistently.
The other works correctly, but the next query returns "Lost connection to MySQL
server during query" and subsequently: "MySQL server has gone away".

I'm using MDB2 to access the database. I tried changing the driver from
'mysql' to 'mysqli', with little success. Currently, about half of the queries
lead to a lost connection, with no apparent pattern. Current PHP code:

$multi_query = $this->db->setOption('multi_query', true);
$res =& $this->db->query($query);
$data1 = $res->fetchAll();
$id = $data1[0]['@chosen']; // this is the result I want

// some people said the problem is related to data that is not read.
// this loop, however doesn't seem to help at all.
while ($res->nextResult()) {
$row =& $res->fetchRow();

// freeing the resource doesn't help either.
$multi_query = $this->db->setOption('multi_query', false);

The stored procedure works correctly 100% of the time in mysql CLI.

Help. Any help at all, please. Thanks,

Bruno Barberi Gnecco <>
Fuch's Warning:
If you actually look like your passport photo, you aren't well
enough to travel.
Mar 5 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.