php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25368 Mysql_pconnect() issues
Submitted: 2003-09-02 17:24 UTC Modified: 2003-09-02 17:54 UTC
From: abrahamkou at sbcglobal dot net Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.3.3 OS: Windows 2003
Private report: No CVE-ID: None
 [2003-09-02 17:24 UTC] abrahamkou at sbcglobal dot net
Description:
------------
mysql_pconnect sometimes ignores the open connection and starts a new connection -- but if you refresh the page again, it will re-use the old connection again.  I am using temporary tables with a form with an action to $PHP_SELF with mutiple steps (meaning the form refreshes itself over and over and displays different fields) that stores interim data into a temporary table.  I noticed about once out of every 5 page loads i'll get a message staying Table (tmeporary_table_name) does not exist.  However, if I refresh it, it will come back.  I looiked at the mysql_thread_id(); and it changes when it says the table does not exist, but changes back to the previous threadid when i refresh the page and repost form data.

Reproduce code:
---------------
The form is at: 

http://cia.dyns.cx/add_user.php

Expected result:
----------------
No error messages, and the same connection and same temporary table is used over and over again.

Actual result:
--------------
as you fill out the form, after you click 'next' a few times it will say "table t_23453294598329 does not exist" (the tablename will be different of corse). but if you refresh the page and repost form data, it will work again.

It means that pconnect is creating a new connection despite an old one being opened already; so the temporary table is not accessible to the new connection.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-02 17:54 UTC] sniper@php.net
Please read this page which explains how persistent 
connections really work:

http://www.php.net/manual/en/features.persistent-connections.php

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Feb 12 18:00:02 2026 UTC