VitoCorleone
Programmer
hello,
I have a form which i need to insert records into multiple tables. i am using $_POST to retrieve values from the previous page and have been using the following statement to insert into a single table
$dbQuery = "INSERT INTO staff (staff_no, fname, lname, position_, sex, dob, salary) VALUES ";
$dbQuery .= "('" . $_POST['staffno'] ."','" . $_POST['fname'] . "','" . $_POST['lname'] . "','" . $_POST['pos'] . "','" . $_POST['sex'] . "','" . $_POST['dob'] . "','" . $_POST['salary'] . "')";
mysql_query($dbQuery) or die("Couldn't add file to database");
if i wanted to insert $_POST{'branch'} into table branch which was also taken from the same form how should i go about this?
I have looked for infomation on multipe inserts on the web, butthere doesnt seem to be enough infomation.
I have a form which i need to insert records into multiple tables. i am using $_POST to retrieve values from the previous page and have been using the following statement to insert into a single table
$dbQuery = "INSERT INTO staff (staff_no, fname, lname, position_, sex, dob, salary) VALUES ";
$dbQuery .= "('" . $_POST['staffno'] ."','" . $_POST['fname'] . "','" . $_POST['lname'] . "','" . $_POST['pos'] . "','" . $_POST['sex'] . "','" . $_POST['dob'] . "','" . $_POST['salary'] . "')";
mysql_query($dbQuery) or die("Couldn't add file to database");
if i wanted to insert $_POST{'branch'} into table branch which was also taken from the same form how should i go about this?
I have looked for infomation on multipe inserts on the web, butthere doesnt seem to be enough infomation.