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:[EMAIL PROTECTED]] Sent: Tuesday, May 14, 2002 12:42 PM To: [EMAIL PROTECTED] 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php