Need help adding data to database where the forms are inside a table

hi guys
Need help adding data to database where the forms are inside a table
i cant seem to make it work
below is the code i made

[code]<?php
include(‘connectdb.php’);
?>

Untitled Document

ADD STUDENTS

 

Personal Information
Student Number : Gender : Male Female
Password : Religion :
Last Name : Civil Status : Single Married Widowed Divorced
First Name : Nationality :
Middle Name : Postal Code :
Birth Date : Eligible for Next School Year : Yes No
Birth Place : Enrollment Status : Enrolled Not_Enrolled
Address :
Parent Guardian Information
Father : Father Contact No :
Mother : Mother Contact No :
Parent Address :
Guardian : Guardian Contact No :
Guardian Address :
<?php if(isset($_POST['submit'])) { $stud_no=$_POST['stud_no']; $password=$_POST['password']; $lname=$_POST['lname']; $fname=$_POST['fname']; $mname=$_POST['mname']; $bday=$_POST['bday']; $bplace=$_POST['bplace']; $gender=$_POST['gender']; $religion=$_POST['religion']; $address=$_POST['address']; $civilstatus=$_POST['civilstatus']; $nationality=$_POST['nationality']; $postalcode=$_POST['postalcode']; $father=$_POST['father']; $fcontact=$_POST['fcontact']; $mother=$_POST['mother']; $mcontact=$_POST['mcontact']; $guardian=$_POST['guardian']; $gcontact=$_POST['gcontact']; $paddress=$_POST['paddress']; $gaddress=$_POST['gaddress']; $eligible=$_POST['eligible']; $estatus=$_POST['estatus'];
	$query = "insert into students (stud_no,password,lname,fname,mname,bday,bplace,gender,religion,address,civilstatus,nationality,postalcode,father,fcontact,mother,mcontact,guardian,gcontact,paddress,gaddress,eligible,estatus) values ('$stud_no','$password','$lname','$fname','$mname','$bday','$bplace','$gender','$religion','$address','$civilstatus','$nationality','$postalcode','$father','$fcontact','$mother','$mcontact','$guardian','$gcontact','$paddress','$gaddress','$eligible','$estatus')";
	mysql_query($query) or die (mysql_error());
}

?>

[/code]
Sponsor our Newsletter | Privacy Policy | Terms of Service