dongle19863
2015-11-17 15:46
浏览 42
已采纳

<a href="">对数据库的操作

Is there a way to update a database using 1 click?

i.e

echo "<a href='".$wpdb->query(" UPDATE partners SET active='no' WHERE partner_id='$active_partner->partner_id' ")."'>Disable</a>";
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duai0935 2015-11-17 15:58
    已采纳

    You need to react on a click with an ajax function.

    i.e.

    $('#your_button_id').bind('click', function(){
        function_with_ajax();
    })
    
    function function_with_ajax(){
        $.ajax({
            here you could call the update.php script and transmit dynamic data
        });
    }
    
    打赏 评论

相关推荐 更多相似问题