I have an edit form. I'm fetching the data for the row like this -
if (isset($_GET["id"])) {
$pur_id = intval($_GET["id"]);
} else {
echo "id not set";
}
Then I'm trying to execute the following UPDATE query.
$qry1 = mysqli_query($con,"UPDATE `purchase_info` SET `remarks` ='$remarks' WHERE `pur_info_id` = '$pur_id'");
This query does work but it doesn't update the records in my database. But it updates the record when I simply pass numeric value instead of the variable that I'm putting my row ID in. So if I pass 'pur_info_id' = 1
then it updates my record.
It's very odd. I'm converting the value using int value but still no luck. Please advice. Thanks!!