I am trying to get the ID of each a LISTED data fetched from MySql to UPDATE using a bootstrap model when update button clicks from the same page.
Passed id to the href and converting that to a javascript variable. And using that variable in PHP.
<td colspan="2"><a class="btn btn-danger updatebtn" name="updateuser" href="<?php echo $row['ID']; ?>" data-toggle="modal" data-target="#updateuser">Update</a></td>
$(document).ready(function(){
    $('.updatebtn').click(function() {
      var modelId = $(this).attr('href');
    });
  });
<?php $id1 = "<script>document.write(modelId)</script>"; ?>
