<?php include "layout.php"; ?>

<?php
$id=$_GET['id'];

if($_SERVER['REQUEST_METHOD']=='POST'){
$stmt=$conn->prepare("UPDATE patients SET first_name=?,last_name=?,phone=? WHERE patient_id=?");
$stmt->bind_param("sssi",
$_POST['first_name'],
$_POST['last_name'],
$_POST['phone'],
$id
);
$stmt->execute();
echo "Updated";
}
?>

<div class="card">
<h2>Update Profile</h2>

<form method="POST">
<input name="first_name">
<input name="last_name">
<input name="phone">
<button>Update</button>
</form>
</div>

</div>
</body>
</html>