单击PHP中按钮的ID

I am working on PHP admin panel, where I want to show list of users in the form of HTML table. In each table row there is one button where admin can send notification to the selected user.

I have created the table from below code and shown as expected.:

<div class="table">
<div style="overflow: auto;height: 400px; width: 100%;">
<form method='post'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <th>Id</th>
        <th>Package</th>
        <th>Date</th>
        <th>Referring Agent</th>
        <th>Content Control</th>
    </tr>
    <?php if(!empty($records)){
            foreach($records as $k=>$v){
           ?>
           <tr>
            <td><?php echo $v['id']; ?></td>
            <td><h3><a href="#"><?php echo $v['firstname']; ?></a></h3></td>
            <td><?php echo $v['lastname']; ?></td>
            <td><?php echo $v['email']; ?></td>
            <!--<td><input id='<?php echo $v['id']; ?>' type='submit' name ='send_notification' value='Send Notification'></td>-->
            <td>
            <div class="pagging">
            <a href="#" onclick="sendNotification('<?php echo $v['id'];?>')">Send Notification</a>
            </div>
            </td>
          </tr>
          <?php  
    }
}else{
    ?>
      <tr>
        <td colspan="5" align='center'><?php echo "No record added yet"; ?>
      </tr>
     <?php 
} 
?>

I want to send the 'id' of each row to some function on click of 'send notification' where I can perform DB operations in PHP. I am not able to do that. I want on click of 'send notification' a function in php will execute which will perform some DB operation.

You need to use AJAX. Use below code.

AJAX Code

<script>
    function sendNotification(id)
    {
        $.ajax({
            type: "POST",
            url: "update.php",
            data: {id:id},
            success: function(html) {
                alert("Updated successfully");
            }
        });
    }
</script>

PHP Code : update.php

<?php
if(isset($_POST['id']))
{
    //Update query and operation here
}
?>

Download latest and require jquery from here. Click Here