echo"Connectingasmysql
n";
$connection1=mysql_connect('localhost','mysql','')ordie($php_errormsg);
echo"connection1is$connection1
n";
echo"Selectingtestformysqluser
n";
mysql_select_db('test',$connection1)or@die("Error".$php_errormsg.mysql_error());
echo"Connectionasjoyce
n";
$connection2=mysql_connect('localhost','joyce','')ordie($php_errormsg);
echo"connection2is$connection2
n";
echo"Selectingbooksforjoyceuser
n";
$db2=mysql_select_db('techbizbookguide',$connection2)ordie(mysql_error());
$query1="selectfoofromtest";
$query2="selecttitle,authorFirst,authorLastfrombookinfo";
echo"Queryingtest
n";
$users=mysql_query($query1,$connection1)ordie(mysql_error());
echo"Queryingbooks
n";
$books=mysql_query($query2,$connection2)ordie(mysql_error());
echo"Foosfromtest
n";
while(list($foo)=mysql_fetch_row($users)){
echo$foo,"
n";
}
echo"Booksintechbizbookguide
n";
while(list($title,$authorFirst,$authorLast)=mysql_fetch_row($books)){
//Usetrimincasewehaveabookby"Madonna"or"Prince"or...
echo$title,'by',trim($authorFirst.''.$authorLast),"
n";
}
?>