Re: Connecting to two MySQL databases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sep 30, 2005, at 11:51 AM, Larry E. Ullman wrote:

I had this problem a while ago, when you try to create the second connection to the database with the same login credentials, i.e username and password. If mysql / php detect there is a connection already established with those
details it will return that specfic resouce and not create an new
connection. The only way around this is to create a new username + password for this database and use those details to generate the second connection.


Actually, the mysql_connect() function takes an optional fourth argument indicating whether or not a new connection should be made. If omitted, then PHP will do exactly what you are describing. If set, then PHP will create a new connection, even if the same username/password/host combination is being used.

Larry

--

Is this just a 1|0 (bool)?

Thanks,
Charles

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux