Inserting values into 2 seperate tables (MySQL)
Posted: Thu Jun 06, 2002 2:55 pm
Hi all,
I have a form for user to input:
Here is my question, i have 2 tables, one called home, one called office, I want address1 to be inserted into home table, and I want address2 to be inserted into office table, anybody knows what i have to do with mySQL query? Or what is the better way to do this?
Thank you very much
I have a form for user to input:
Code: Select all
if ($submit)
{
$query = "INSERT INTO home (address1, address2)
values ( '$address1', '$address2')";
print "Your listing has been added!";
}
print "<form name="add" action="add.php" method=post>";
print "Address1: <input type="text" name="address1">";
print "Address2: <input type="text" name="address2">";
print "<input type=submit name=submit value=Submit Listing></form>";Thank you very much