php – Update with Ajax + Pdo

I made UPDATE with AJAX + PDo, however, it only affects one line, the others are not affected. I have tried several things, but I can not solve it if someone can help me.

				
							
				
							
				
							
				
							
function uptade_cat () {

var value_update = $ ("# value_update"). val ();
var id_cat_update = $ ("# id_cat_update"). val ();
var name_category_update = $ ("# category_name_update"). val ();


$ .ajax ({
type: "POST",
url: "box / category_uptade.php",
date: {category_name: category_update_name, value: update_value, cat_id: cat_update_id},
dataType: "JSON",
success: function (data) {
$ (# Value_update & # 39;) val (data.value_uptade);
$ (# Category_name_update & # 39;). val (data.name_category);
$ (# Id_cat_update). val (data.id_cat_update);
$ (# Alert_message3 & # 39;) html (& # 39;& # 39;);
$ (# Category_uptade_form & # 39;). reload ();


}
error: function () {
$ (# Error). html (& # 39;& # 39;);


}
});
}


Edit category
prepare ($ select); $ result-> execute (); $ count = $ result-> rowCount (); if ($ count> 0) { while ($ show = $ result-> FETCH (PDO :: FETCH_OBJ)) { ?> <? php } } else { echo
Warning! There is no article in our database.
& # 39 ;; } } catch (PDOException $ e) { echo $ e; } ?>
Registration Category Value Edit
category_name;?> category;?> value <a href = "" class = "warning-btn" data-toggle = "modal" data-target = "# quotgoria_id_cat;?> "> Edit
prepare ('SELECT * from box_category'); $ result-> execute (); while ($ show = $ result-> FETCH (PDO :: FETCH_ASSOC)): ?> <div class = "modal fade" id = "cotegoria_"tabindex =" - 1 "role =" dialog "aria-labelledby =" exampleModalLabel "aria-hidden =" true ">

catégorie_uptade

 prepare ("UPDATE box_category SET category_name =: category_name, value =: WHERE value cat_id =: id_cat");

$ stmt-> bindparam (: id_cat, $ id_cat);
$ stmt-> bindparam (: category_name, $ category_name);
$ stmt-> bindparam (: value, $ value);


if ($ stmt-> execute ())
{
$ res = "Data inserted successfully:";
echo json_encode ($ res);
}
if not {
$ error = "Not inserted, sometimes probel occurs.";
echo json_encode ($ error);
}

?>