You didn't set order_id
in javascript.
$(function() {
$(".accept").click(function(){
var element = $(this);
var del_id = $(this).attr('id');
var order_id = //something collect order_id
var info = 'id=' + del_id + '&order_id=' + /*order_id value*/;
$.ajax({
type: "POST",
url: "accept.php",
data: info,
success: function(){}
});
$(this).parents(".show").animate({ backgroundColor: "#003" }, "slow")
.animate({ opacity: "hide" }, "slow");
});
});
because you used AND
in your query and you didn't set $_POST['order_id']
, and then $name
, your query will always return false...
and I think you should recheck this part:
$sql = "UPDATE mgap_ska SET mgap_status = '1' WHERE mgap_ska_id = '".$id."' AND mgap_ska_report_category = '".$name."';";
$stmt = $pdo->prepare($sql);
$stmt->execute(array(
':id' => '$id',
':name' => '$name'
));
try this type :
$sql = "UPDATE mgap_ska SET mgap_status = '1' WHERE mgap_ska_id = :id AND mgap_ska_report_category = :name;";
$stmt = $pdo->prepare($sql);
$stmt->execute(array(
':id' => $id,
':name' => $name
));