Php sweet alert(当我单击sweet alert confirm按钮时,我想将数据库状态(默认:待定)更新为confirm

Php sweet alert(当我单击sweet alert confirm按钮时,我想将数据库状态(默认:待定)更新为confirm,php,jquery,mysql,codeigniter,Php,Jquery,Mysql,Codeigniter,这是我的sweetalert,当我单击此确认按钮时,我想更新我的数据库状态列。请帮助我,谢谢 swal({ title: 'Are you sure?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, confirmButtonColor: '#228B22', cancelButtonColor: '#d33', co

这是我的sweetalert,当我单击此确认按钮时,我想更新我的数据库状态列。请帮助我,谢谢

swal({
    title: 'Are you sure?',
    text: "You won't be able to revert this!",
    type: 'warning',
    showCancelButton: true,
    confirmButtonColor: '#228B22',
    cancelButtonColor: '#d33',
    confirmButtonText: 'Yes, confirm it!'
}).then(function () {
swal(
    'Confirmed!',
    'success'
)
})

您可以在回调函数中编写代码

检查下面的代码

swal({
  title: 'Are you sure?',
  text: "You won't be able to revert this!",
  type: 'warning',
  showCancelButton: true,
  confirmButtonColor: '#228B22',
  cancelButtonColor: '#d33',
  confirmButtonText: 'Yes, confirm it!'
}).then(function () {

  // write your code in the response of ajax call
  $.ajax({
    url:"",
    success:function(resp){
      swal('Confirmed!','success')
    }
  });
})

您可以在回调函数中编写代码

检查下面的代码

swal({
  title: 'Are you sure?',
  text: "You won't be able to revert this!",
  type: 'warning',
  showCancelButton: true,
  confirmButtonColor: '#228B22',
  cancelButtonColor: '#d33',
  confirmButtonText: 'Yes, confirm it!'
}).then(function () {

  // write your code in the response of ajax call
  $.ajax({
    url:"",
    success:function(resp){
      swal('Confirmed!','success')
    }
  });
})

AJAX在猜测时调用,但您需要显示更多的efforthow我可以这样做吗?这可能有助于AJAX在猜测时调用,但您需要显示更多的efforthow我可以这样做吗?这可能有帮助