$db = mysql_connect("localhost", "root");
mysql_select_db("Health",$db);
$sql = "INSERT INTO persons (First_Name,Last_Name,DOB,Address1,Address2,Home,Fax,Mobile,Email) VALUES ('$First_Name','$Last_Name','$DOB','$Address1','$Address2','$Home','$Fax','$Mobile','$Email')";
$result = mysql_query($sql);
$sql = "INSERT INTO customers (Person_ID,WorkNumber,Occupation,MedicareNumber) VALUES ('$Person_ID','$WorkNumber','$Occupation','$MedicareNumber')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
ok. thats my code so far. whats happening is it writes from one for, to two different tables. it works fine, but what i cant figure out how to do is this. when it inserts into the first table, an auto number is generated, Person_ID. i wanna get that number, and put that into the next table, the customers one, along with the other data.