i use edt delete in data tables but when i refresh my page than data will be updated.

i use edt delete in data tables but when i refresh my page than data will be updated.

mbavaiyambavaiya Posts: 1Questions: 0Answers: 0

i use edt delete in data tables but when i refresh my page than data will be updated.
why i every time refresh my page

when i click delete button page will be refresh but data cant updated and when i again refresh my page data table will be updated ..

please help me ...

<html>
<head>
<?php include 'include/headerscript.php';?>

<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://jqueryvalidation.org/files/dist/jquery.validate.min.js"></script>
<script src="http://jqueryvalidation.org/files/dist/additional-methods.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.11/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.11/js/jquery.dataTables.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/t/dt/dt-1.10.11/datatables.min.css"/>

$(document).ready(function() { var table = $('#example').DataTable(); table.fnReloadAjax( 'view_category.php' ); });

</head>
<body>
<?php include 'include/headeradmin.php';?>
<?php include 'include/asidebar.php';?>

List All Category Control panel

  1. Home
  2. List View
  3. Category

Data Table With Full Features

<?php include 'include/connection.php'; $view_category="select category_name,id from main_category"; $display_all_category=$conn->query($view_category); while($row=$display_all_category->fetch_assoc()) { ?> <?php } ?>
Category Name Update Category Delete Category
<?php echo $row['category_name'];?> " >EDIT " onclick='location.reload(true); return true;'>DELETE

</div>
</div>
</section>
</div>
<?php if(isset($_GET['id'])) { $id_delete=$_GET['id']; $selete_category="delete from main_category where id='$id_delete'"; $display_delete=$conn->query($selete_category); } ?>
<?php if(isset($_GET['ids'])) { $id_edit=$_GET['ids']; $id_update="update category_name from main_category where id=$id_edit"; $result_update=$conn->query($id_update); //$update_category="select "; echo " alert('Update Reecord Successfully')"; } ?>

<?php include 'include/aside_right.php';?>
<?php include 'include/footer.php';?>
</body>
</html>

Replies

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    Could you clarify what editing you are using please? I doesn't look like, from the above code, that you are using Editor. Are you using something else?

    Allan

This discussion has been closed.