469,626 Members | 979 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

Lost connection with stored procedures and PHP

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 <brunobg_at_users.sourceforge.net>
Fuch's Warning:
If you actually look like your passport photo, you aren't well
enough to travel.
Mar 5 '07 #1
0 1499

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Steve Franks | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.