I\'ve set two database conections as below $con1 = mysql_connect(\"localhost\", \"root\", \"pwd\") or die (mysql_error());