473,795 Members | 3,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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('mul ti_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('mul ti_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_use rs.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 1737

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8005
by: meng | last post by:
is it possible to use a single connection object shared by several tasks where each task is handled by a thread? these tasks call stored procedures that return record sets, no editing, update or delete. my objective is that db connection is expensive and each user can only have 1 connection object. each user submits a request to the web server, and the result web page construction consists of a number of result sets obtained from several...
4
2049
by: Minh Tran | last post by:
In order to minimize the number of connection strings I have to use to access different databases on the same Sql Server, I was considering storing all stored procedures in just one database. I want to do this because connection pooling in my application - ASP.NET is based on this connection string. So if I need to access 6 different databases on one sql server & set 6 different connection strings, I end up creating 6 different...
3
2704
by: sans_spam | last post by:
I want to pull 2 different recordsets using 2 different stored procedures using the same Data Connection. Below is the code that I currently have, but I'm getting an 'Object Required' error message. Am I doing this correctly, or at least headed in the right direction? Can someone tell me the most efficient way (provide a code example) to pull 2 different recordsets from the same Data Connection? Set dConn =...
2
2077
by: moosedeja | last post by:
I have an ASP (IIS 4.0) based website fronting a SQL Server 2000 database. I am trying to avoid using dynamic SQL for queries, and I am considering prepared statements as an alternative... All the advice I have seen strongly suggests that connection objects should not be explicitly cached, either at the application or session level. Therefore, I am creating a connection for each page (same connection string), and closing it immediately...
9
2989
by: Janick | last post by:
With DB2 7.2 we used to call methods from other SQLJ Stored Procedures, as it was not possible to call SPs via the SQL Call-statement from within SPs. So we always had a method like this: protected static void execute(Connection con, (...)) Where we passed a Connection object for dynamic SQL (which we got using the getConnection() method of the DefaultContext). Static SQL was always executed on the DefaultContext.
14
9065
by: jj | last post by:
Is it possible to call a remote php script from within Access? I'm thinking something like: DoCMD... http://www.domain.com/scripts/dataquery.php DoCmd.OpenQuery "update_data", acNormal, acEdit ..... So the PHP script does something on the server database, then when a linked table is viewed within access, the data changes have been made?
7
1374
by: Steve Franks | last post by:
Using VS.NET 2005 RC - Am I understanding correctly from the docs that connection pooling for my ADO.NET db connections will happen automatically? Do I need to do anything to enable this feature? Basically I have code in a method that does this: SqlConnection conn = null; try { conn = new SqlConnection("Data Source=myserver;Initial
1
3739
by: hal9000cr | last post by:
We are running into some problems with the execution of DB2 stored procedures when their isolation level is set to: set transaction isolation level READ UNCOMMITTED, READ WRITE; This is a web application running in JBoss 4.0.1 where a standard DataSource in JBoss is defined for connections against a DB2 database on an AS/400 (VRM = V5R2M0). The driver is established as: <driver-...
2
5303
by: trickyidiot | last post by:
I don't even know if this is possible - I'm still fairly new to stored procedures. I have 4 tables I need to compile data from: saved_searches saved_homes printed_homes member_info saved_searches, saved_homes and printed_homes each track the date they were created.
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10435
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9037
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.