note 65956 added to function.mysql-select-db
| From: | matsko at rogers dot com | Date: | Wed, 10 May 2006 19:19:28 +0000 |
| Subject: | note 65956 added to function.mysql-select-db | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111083@lists.php.net to get a copy of this message | ||
Just incase the mysql_select_db() function still won't work with multiple database connections
(as has happened to me before).
$dbh1 = mysql_pconnect($host,$user,$pass);
$dbh2 = mysql_pconnect($host,$user,$pass);
You could do this...
mysql_query("USE database1",$dbh1);
mysql_query("Use database2",$dbh2);
This does the same thing as the mysql_select_db() function...
or this...
You don't even have to select the database for each connection.
mysql_query("SELECT * FROM database1.table",$dbh1);
mysql_query("SELECT * FROM database2.table",$dbh2);
----
Server IP: 66.207.199.35
Probable Submitter: 24.43.218.15
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.mysql-select-db.php
Edit -- http://master.php.net/note/edit/65956
Del: integrated -- http://master.php.net/note/delete/65956/integrated
Del: useless -- http://master.php.net/note/delete/65956/useless
Del: bad code -- http://master.php.net/note/delete/65956/bad+code
Del: spam -- http://master.php.net/note/delete/65956/spam
Del: non-english -- http://master.php.net/note/delete/65956/non-english
Del: in docs -- http://master.php.net/note/delete/65956/in+docs
Del: other reasons-- http://master.php.net/note/delete/65956
Reject -- http://master.php.net/note/reject/65956
Search -- http://master.php.net/manage/user-notes.php