Quote:
|
Originally Posted by jazzmatazz2005
how do i change this login script to check 2 databases.
|
Assuming that the databases exist on the same server, you should be able use mysql_db_query() instead of the combination of mysql_select_db() and mysql_query().
http://us.php.net/function.mysql-db-query
You should then be able to check the databases one at a time using two mysql_db_query() statements.
Code:
mysql_db_query("db1",$query);
mysql_db_query("db2",$query);
For multiple servers, its best to give each connection its own handle and refer to the handle when processing the query:
Code:
$handle_db1 = mysql_connect("localhost","myuser","apasswd");
$handle_db2 = mysql_connect("127.0.0.1","myuser","apasswd");
mysql_select_db("db1",$handle_db1);
mysql_select_db("db2",$handle_db2);
$query = "select * from test"; $which = $handle_db1;
mysql_query($query,$which);