Bug #10032 Updated: mysql_connect not making a new connection each time it is called
| From: | georg@php.net | Date: | Mon, 22 Jul 2002 06:38:48 +0000 |
| Subject: | Bug #10032 Updated: mysql_connect not making a new connection each time it is called | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-14764@lists.php.net to get a copy of this message | ||
ID: 10032
Updated by: georg@php.net
Reported By: kwatt@buybuddy.com
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: red hat linux
PHP Version: 4.0.4pl1
New Comment:
Since PHP 4.2.0 you can use the optional parameter new_link, to create
a new connection with mysql_connect.
See http://www.php.net/manual/en/function.mysql-connect.php
Previous Comments:
------------------------------------------------------------------------
[2001-03-27 17:21:51] kwatt@buybuddy.com
In the documentation, it says that one way mysql_pconnect and
mysql_connect is that in pconnect, it opens a new connection only if
there is not one open to the same host,username,password tuple.
However, mysql_connect does the same thing.
The thing I find annoying about the fact that mysql_connect not
automatically opening a new connection is that there are some functions
that change the attributes of a connection overall. When you call
mysql_select_db on a connection, you are changing the database for
every instance that is referencing that same connection. There is no
way to make one connection that refers to one database, and one that
refers to another.
Really, there should be two mysql_connect functions:
1) mysql_new_connect
and
2) mysql_connect
mysql_new_connect would make a new connection to the database no matter
what.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=10032&edit=1