You are here: Lost connection with stored procedures and PHP « PHP Programming Language « IT news, forums, messages
Lost connection with stored procedures and PHP

Posted by Bruno Barberi Gnecco on 03/05/07 22:54

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация