<?php
include_once 'dbconnect.php';
$id=$_GET['/'];
$sql="select * from vritant_tbl where id='{$id}'";
$result_set=mysqli_query($con,$sql);
$count=mysqli_affected_rows($con);
if($count>0){
$data=mysqli_fetch_assoc($result_set);
$id=$data['id'];
$name=$data['name'];
$email=$data['email'];
$mobile=$data['mobile'];
}else{
echo "No Record Found";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit</title>
</head>
<body>
<h1>Edit Record</h1>
<form action="editcode.php?/=<?php echo basename($_SERVER['PHP_SELF']); ?>" method="post">
<fieldset style="width:40%">
<legend>Edit</legend>
<p>
Enter Name*
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="text" name="name" value="<?php echo $name ?>">
</p>
<p>
Enter Email*
<input type="email" name="email" value="<?php echo $email ?>">
</p>
<p>
Enter Mobile*
<input type="number" name="mobile" value="<?php echo $mobile; ?>">
</p>
<input type="submit" name="submit" value="Submit">
</fieldset>
</form>
</body>
</html>
0 Comments