From: abrahamkou at sbcglobal dot net
Operating system: Windows 2003
PHP version: 4.3.3
PHP Bug Type: MySQL related
Bug description: Mysql_pconnect() issues

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:

[url]http://cia.dyns.cx/add_user.php[/url]

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.

--
Edit bug report at [url]http://bugs.php.net/?id=25368&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25368&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25368&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25368&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25368&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25368&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25368&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25368&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25368&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25368&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25368&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25368&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25368&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25368&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25368&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25368&r=gnused[/url]