How would you go about inserting multiple rows into a db if certain fields contained data? This is what I have attempted:
if (isset($REQUEST['register_case']) && !empty($POST['p1_firstname']) {
$register_case = mysql_query ("INSERT INTO cases VALUES ('$case','$p1_firstname','$p1_lastname','$city')");
header ('Location: review.php');
exit ();
}
elseif((isset($REQUEST['register_case'])) && (!empty($POST['p2_firstname'])) {
$register_case = mysql_query ("INSERT INTO cases VALUES
('$case','$p2_firstname','$p2_lastname','$city')");
header ('Location: review.php');
exit ();
}
I want the case and city to remain the same, just the first name and last name to change. What am I doing wrong with this?