Lost connection with stored procedures and PHP

This is a discussion on Lost connection with stored procedures and PHP within the MySQL Database forums, part of the Database Forums category; I'm using stored procedures in a PHP site, with mysql. I'm having problems with stored procedures. Of the ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-05-2007
Bruno Barberi Gnecco
 
Posts: n/a
Default 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.
$res->free();
$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.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:16 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0