<?php

$con=mysqli_connect("localhost","root","","test");
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>
<?php

$strSQL = "UPDATE student SET ".$_POST[rollno]."' ";
$strSQL .=",name = '".$_POST["name"]."' ";
$strSQL .=",phone = '".$_POST[phone]."' ";
$strSQL .=",address = '".$_POST["address"]."' ";
$strSQL .=",salary = '".$_POST[salary]."' ";
$strSQL .="WHERE rollno = '".$_POST[rollno]."' ";
$query = mysql_query($strSQL);

$result = mysqli_query($query,$con);

echo "<table border='3' bgcolor='#FFFF00'>
<tr>
<th>Roll</th>
<th>Name</th>
<th>Phone</th>
<th>Address</th>
<th>Salary</th>
</tr>";

while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row[rollno] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row[phone] . "</td>";
echo "<td>" . $row['address'] . "</td>";
echo "<td>" . $row[salary] . "</td>";
echo "<td colspan='6' align='center'><a href=update.php?id=".$row[rollno].">Update</td>";
echo "</tr>";
}

echo "</table>";
?>