I am opening 4 different databases and was hoping when I do a mysql_query I could just grab the connection id rather than reconnecting everytime I want to query a new database.
But what does that have to do with wanting a unique identifier?
If you want to switch databases, just invoke mysql_select_db(), or use mysql_query() to issue a "USE db_name" statement. No need to open a new connection for each database.
-----Original Message----- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 9:08 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: unique identifier using mysql_connect
At 12:43 -0700 7/30/03, Grant Cooper wrote:Can I get a unique identifier using the mysql_connect command by connecting to the same host, same user but different database during the life time of one script?
I currently do a $conn_id = mysql_connect ($host_name, $user_name, $password);
Then call a, mysql_select_db ($db_name,$conn_id)
But I always get the same identifier.
Why is this a problem? This is fairly typical behavior for PHP (which is what it looks like you're using).
-- Paul DuBois, Senior Technical Writer Madison, Wisconsin, USA MySQL AB, www.mysql.com
Are you MySQL certified? http://www.mysql.com/certification/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]