This question already has an answer here:
I am new in PHP. I have to try to make a management system with PHP for learning purpose. there is a payment system which is two options one is "paid" and another is "paid later". Now I want to update from the site and use this code --
if(isset($_POST['pay_update'])){
$payment = $_POST['payment'];
$query = "update doctorapp set payment='$payment' where id='$id'";
$result = mysqli_query($connect, $query);
if($result){
echo "<script>alert('Update Success...')</script>";
echo "<script>window.open('patient-details.php', '_self')</script>";
}else{
echo "Update Failed...";
}
}
when I use 'id' it shows undefine index, and when I do not use 'id' it's working but change for all id. Now I want to know how I will update data for individual 'id'...?
enter code here
</div>