delete-data-without-refreshing-page
Thnx.....
my problem has been shor tout of this tutorial....
and thnx again
<table> <thead> <tr> </tr> </thead> <tbody> <?php $result = $database->prepare ("SELECT * FROM tbl_member"); $result ->execute(); for ($count=0; $row_member = $result ->fetch(); $count++){ $id = $row_member['tbl_member_id']; ?> <tr class="delete_mem<?php echo $id ?>"> <td width="80"> </td> </tr> <?php } ?> </tbody> </table>
<script type="text/javascript"> $(document).ready(function() { $('.btn-danger').click(function() { var id = $(this).attr("id"); if (confirm("Are you sure you want to delete this Member?")) { $.ajax({ type: "POST", url: "delete_member.php", data: ({ id: id }), cache: false, success: function(html) { $(".delete_mem" + id).fadeOut('slow'); } }); } else { return false; } }); }); </script>
<?php include ('database.php'); $id = $_GET['id']; $delete_data"delete from tbl_member where tbl_member_id = '$id' "; ?>