当我单击按钮时,如何更新已批准的“状态”字段?
function UpdateRecord(id) {
jQuery.ajax({
type: "POST",
url: "update.php",
data: 'id=' + id,
cache: false,
success: function(response) {
alert("Record successfully updated");
}
});
}
答案 0 :(得分:0)
<script>
function UpdateRecord(id)
{
jQuery.ajax({
type: "POST",
url: "update.php",
data: {id:id},
cache: false,
success: function(response)
{
alert("Record successfully updated");
}
});
}
</script>
和update.php
<?php
if(isset($_POST['id']))
{
$id = $_POST['id'];
// update here to this id..
}
?>