1. HTML Source Code(Index.php)

<?php
$conn=mysqli_connect("localhost", "root", "", "testproject");
$fetchQry=mysqli_query($conn, "SELECT * FROM userdetails WHERE id=1");
$rows=mysqli_fetch_array($fetchQry);
?>

<form action="send.php" method="post">
<input type="hidden" name="id" value="<?php echo $rows['id']; ?>">
<input type="text" name="name" value="<?php echo $rows['name']; ?>">
<input type="submit" name="submit" value="Submit">
</form>

2. PHP Source Code(send.php)

<?php
$conn=mysqli_connect("localhost", "root", "", "testproject");
$name=$_POST["name"];
$id=$_POST["id"];
$query=mysqli_query($conn, "UPDATE userdetails SET name='$name' WHERE id='$id'");
if(query==true){
echo"Successfully Inserted";
}
else{
echo"Inserted Failed";
}
?>