There isn’t any mistake in my code but still am not getting my data inserted into mysql database using html … please guide me if there is any mistake within it
<html>
<head>
<title>
STUDENTS RECORD
</title>
</head>
<body>
<form action="students.php" method="post ">
<table width="600" border="10" align="center" >
<tr>
<td bgcolor="blue" align="center" colspan="5" ><h2>STUDENT'S REGISTRATION</h2></td>
</tr>
<tr>
<td align="right" >STUDENT NAME:</td>
<td ><input type="text" name="student_name" ></td>
</tr>
<tr>
<td align="right" >SCHOOL NAME:</td>
<td><input type="text" name="school_name"></td>
</tr>
<tr>
<td align="right" >ROLL NO:</td>
<td><input type="text" name="roll_number"></td>
</tr>
<tr>
<td align="right" >STATUS:</td>
<td><input type="text" name="status"></td>
</tr>
<tr>
<td align="right" colspan="5" ><input type="submit" name="submit" value="SUBMIT"</td>
</tr>
</table>
</form>
<table width="600" border="10" align="center">
<tr>
<th>Serial No.</th>
<th>STUDENT NAME</th>
<th>SCHOOL NAME</th>
<th>ROLL NO</th>
<th>STATUS</th>
<th>Delete</th>
<th>Edit</th>
</tr>
<?php
mysql_connect("localhost","root","");
mysql_select_db("school");
$query1="select * from students";
$run=mysql_query($query1);
while($row=mysql_fetch_array($run))
{
$id=$row['ID'];
$s_name=$row['NAME'];
$school=$row['SCHOOL_NAME'];
$roll=$row['ROLL_NUMBER'];
$result=$row['STATUS'];
?>
<tr align="center" >
<td><?php echo $id; ?></td>
<td><?php echo $s_name; ?></td>
<td><?php echo $school; ?></td>
<td><?php echo $roll; ?></td>
<td><?php echo $result; ?></td>
<td>Delete</td>
<td> Edit</td>
<?php } ?>
</tr>
</table>
</body>
</html>
<?php
mysql_connect("localhost","root","");
mysql_select_db("school");
if (isset($_POST['submit']))
{
$name=$_POST['student_name'];
$school=$_POST['school_name'];
$roll=$_POST['roll_number'];
$result=$_POST['status'];
$query ="insert into students(NAME,SCHOOL_NAME,ROLL_NUMBER,STATUS) values ('$name','$school','$roll','$result')";
}
?>