Here is PHP code to edit the record! Look at your MySQL database.seard

PHP code ( update.php)!

<form action="update.php" method="post">
<?php
$text="";$text1="";$text2=""; $btn="";
$hid="style='visibility:hidden'";
$r1="";$r2="";$r3="";$nt="";
$codeerr="";
$code="";
$flag=0;
if(isset($_POST["submit"]))
{
if(empty($_POST["t1"]))
{
$codeerr="Data Missing";
$flag=0;
}
else if(is_numeric(trim($_POST["t1"]))==false)
{
$codeerr="Accept Numeric value only";
$flag=0;
}
else
{
$code=$_POST["t1"];
$flag=1;
}
}
?>
<?php
if($flag!=0)
{
$server='localhost';
$username='root';
$password='';
$cnt=0;
try
{
$db=new PDO("mysql: host=$server; dbname=softaid",$username, $password);
$result=$db->query('select *from student where rollno='.$code);
$result->setFetchMode(PDO::FETCH_ASSOC);
$row=$result->fetch();
$cnt=count($row);
if($cnt>1)
{
$hid="style='visibility:visible'";
$rl=$row["rollno"]; 
$text="<input type='text' name='ro' value='$rl' readonly='readonly' />";
$r2=$row["sname"]; 
$text1="<input type='text' name='na' value='$r2' />";
$r3=$row["scourse"]; 
$text2="<input type='text' name='co' value='$r3' />";
$btn=""; 
if(isset($_POST["submit"])) 
{ 
$btn="<input type='submit' name='edit' value='Update'
 style='border-radius:5px; padding:2px; color:maroon' />";      
} 
}
else
{
echo"<h2 style=' text-align:center'>Record not Found</h2>";
}
}
catch(PDOException $e)
{
echo $e->getMessage();
}
}
if(isset($_POST['edit']))
 {
 $rr=$_POST["ro"];
 $rn=$_POST["na"];
 $rc=$_POST["co"];
$server='localhost';
$username='root';
$password='';
$cnt=0;    
$db=new PDO("mysql: host=$server; dbname=softaid",$username, $password);
$stmt=$db->prepare("update student set sname= '$rn', scourse='$rc' WHERE rollno = :rollno");
$stmt->bindParam(':rollno',$rr);
$count=$stmt->execute(); 
if($count>0)
{
 echo "<h2 style=' text-align:center'>update record successfull.</h2>";
}
 }
?>
<!--Designing of table -->
<table  style="margin:auto; background-color:#FFF; color:#C03;   ">
<tr>
</tr>
<tr>
</tr>
</table>
<div style="width:695px; padding:13px 0px; border-radius:30px 30px 0 0;
 background-color:#00A7CA; color:#FFF; margin:auto; font-size:20px;font-family:Tahoma,
 Geneva, sans-serif; text-align:center;">Search & Update</div>
<table  style="width:695px; margin:auto; font-family:Tahoma, Geneva, sans-serif; 
color:#666; background-color:#FF9; text-align:center">
<tr>
<td >Enter Student Roll No.</td>
<td width="450px"><input type="text" name="t1" style="width:100%; height:25px"
 placeholder="<?php echo $codeerr ?>"  /></td>
<td >
<input type="submit" name="submit" value="search" style="padding:3px; width:100px; font-size:18px" />
 </td>
</tr>
</table>
<div style="width:695px; padding:20px 0px; border-radius:0px 0px 20px 20px;
 background-color:#00A7CA; color:#FFF; margin:auto; font-size:18px; text-align:center;"></div>
<br />
<div <?php echo $hid; ?>>
<div style="width:695px; padding:13px 0px; border-radius:30px 30px 0 0; 
background-color:#00A7CA; color:#FFF; margin:auto; font-size:20px;font-family:Tahoma, 
Geneva, sans-serif; text-align:center;">Update</div>
<table  border="1" style="width:695px; margin:auto; font-family:Tahoma, Geneva, sans-serif; color:#666;
 background-color:#FF9; text-align:center">
<tr>
<th>Roll NO.</th><th>Name</th><th>Course</th>
</tr>
<tr><td colspan="3"><?php echo $nt; ?></td></tr>
<tr>
<td><?php echo $text; ?></td><td><?php echo $text1; ?></td><td><?php echo $text2; ?></td>
<td><?php echo $btn; ?></td>
</tr>
</table>
<div style="width:695px; padding:20px 0px; border-radius:0px 0px 20px 20px;
 background-color:#00A7CA; color:#FFF; margin:auto; font-size:18px; text-align:center; color:#fff"></div>
</div>
</form>

run the page at server!

supd

upda

edit "Karan" to "PGDCA" and press update button! 

usucc