RE: [PHP-DB] Multiple DB's
| From: | USA) | Date: | Tue, 14 May 2002 18:37:43 +0000 |
| Subject: | RE: [PHP-DB] Multiple DB's | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-19179@lists.php.net to get a copy of this message | ||
mysql_db_query lets you pick the database,
if you use mysql_query then you need to use mysql_select_db("dbname",connection) before
hand.
http://www.php.net/manual/en/function.mysql-db-query.php
- you pick the database for this
http://www.php.net/manual/en/function.mysql-query.php
- uses the currently active database.
-----Original Message-----
From: Morten Nielsen [mailto:mosgaard2000@hotmail.com]
Sent: Tuesday, May 14, 2002 12:42 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Multiple DB's
Hi,
I use MySQL and are trying to have 2 open databases. I do like this:
$db1=db_connect($CFG->dbhost, "DB1", $CFG->dbuser, $CFG->dbpass);
$db2=db_connect($CFG->dbhost, "DB2", $CFG->dbuser, $CFG->dbpass);
Then I am trying to run a CREATE TABLE,
$qid = db_query("
CREATE TABLE tmp (
Dato INT(2) )
");
but I don't know how to specify which database it should use.
How do I specify wether it should use db1 or db2?
Regards,
Morten
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php