heyy guys....i manage to connect to diff database in a single form...but how do i compare the value...
for eg. now i would to compare invoice_no for the both of them
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="test3"; // Table name
$db_name1="test1"; // Database name
$tbl_name1="test2"; // Table name
// Connect to server and select database.
$dbh1=mysql_connect("$host", "$username", "$password")or die("cannot connect");
$dbh2=mysql_connect("$host", "$username", "$password",true)or die("cannot connect");
mysql_select_db("$db_name", $dbh1)or die(mysql_error());
mysql_select_db("$db_name1", $dbh2)or die(mysql_error());
$invoiceno=$_POST['invoiceno'];
$_SESSION['invoice_no']=$invoiceno;
$sql="SELECT * FROM $tbl_name WHERE invoice_no = '$invoiceno'";
$result=mysql_query($sql,$dbh1);
$row=mysql_fetch_array($result) or die(mysql_error());
echo "$row";
if($row>0)
{
echo "Invoice No. found";
}
else //invoice no. not found, prompts user again
{
echo "ngek ngek";
}
could someone guide me please