i have a following mysql table, where multiple user has accepted a lead (lead_id). here i want to stop updating table column 'Value' when 'status' is 'settled
<?php
$sql = "SELECT `status`,`email_id` FROM `deal_request` WHERE `client_id` = '$client_id'";
$query = mysqli_query($connection, $sql);
if ($query->num_rows > 0) {
while ($row = mysqli_fetch_assoc($query)) {
$status = $row['status'];
if ($status == 'pending') {
$sql = "UPDATE `deal_request` SET `status`='settled',`share_userdetails` ='2' WHERE `client_id`='$client_id' AND `dealer_id`='$dealer_id'";
$query = mysqli_query($connection, $sql);
if ($query == true) {
echo " <script>
alert(\"You Have Successfully Released The Lead\");
window.location.replace(\"LeadDetails.php?client_id=$client_id&&dealer_id=$dealer_id\");
</script>";
}
} else {
echo 'you can not change';
echo " <script>
alert(\"You cannot select this dealer, another dealer has been selected aleady!\");
window.location.replace(\"LeadDetails.php?client_id=$client_id&&dealer_id=$dealer_id\");
</script>";
}
}
}
?>
