I'm trying to connect to two databases and I'm having problems with the following code. I googled to come up with this but can't figure out the errors I'm getting.
$connection="localhost";
$username="user";
$password="password";
$database1="dbone";
$database2="dbtwo";
$db1 = mysql_connect($connection,$username,$password) or die(mysql_error());
$sel1 = mysql_select_db($database1, $db1);
$query1 = "SELECT * FROM TBLUSERS";
$result1 = mysql_query($query1, $db1);
while($nt1 = mysql_fetch_array($result1, $db1))
{
}
$db2 = mysql_connect($connection,$username,$password) or die(mysql_error());
$sel2 = mysql_select_db($database2, $db2);
$query2 = "SELECT * FROM TBLPD20101101";
$result2 = mysql_query($query2, $db2) or die(mysql_error());
while($nt2 = mysql_fetch_array($result2, $db2))
{
}
The error I get is