my form has an option where user can choose to fill but should that option be choose then the form will will submit to two tables if not chosen the one table using php/mysql.table being patient and insurance table. Prompt assistance will be appreciated.thanks
$query = "insert into patients (title,patientid,name1, name2, name3, dob, gender, marital, image, address,mobilenumber, emergencynumber,city,position,employername,relationship,insuranceprovider) values ('$thistitle','$thisid','$thisname1','$thisname2','$thisname3','$thisdate','$thisgender','$thismarital','$thisphoto','$thisaddress','$thismobile','$thisemergency','$thiscity','$thisposition','$thisemployername','$thisrelationship','$thisinsuarance')";
$result = mysql_query($query);
echo 'successful';
if($result){
echo 'successful';
$sql="insert into insuarance_table set patient_id='$thisid', insuarance_no='$thisinsid',place_of_reg='$thisdistrict',date_expiring='$thisdoe',date_reg='$thisdoi'";
$sql1=mysql_query($sql);
if(!$sql1){
echo 'wrong'.mysql_error();
}
}