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.
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"/>
</head>
<body>
<?php include 'include/headeradmin.php';?>
<?php include 'include/asidebar.php';?>
<
form >
<
div class="content-wrapper" style="min-height: 916px;">
<section class="content-header">
<h1>
List All Category
<small>Control panel</small>
</h1>
<ol class="breadcrumb">
<li><a href="category.php"><i class="fa fa-dashboard"></i> Home</a></li>
<li><a href="view_category.php"></i> List View</a></li>
<li class="active">Category</li>
</ol>
</section>
<section class ="content">
<div class="row">
<div class="box">
<div class="box-header">
<h3 class="box-title">Data Table With Full Features</h3>
</div><!-- /.box-header -->
<div class="box-body display">
<div id="example1_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row"><div class="col-sm-12">
<table class="table display table-bordered table-striped dataTable" id="example" role="grid" aria-describedby="example1_info">
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="example1" rowspan="1" colspan="1" style="width: 109px;align : center;" aria-label="Rendering engine: activate to sort column descending" aria-sort="ascending">Category Name</th>
<th class="" tabindex="0" aria-controls="example1" rowspan="1" colspan="1" style="width: 143px;align:center;" aria-label="Browser: activate to sort column ascending"> Update Category </th>
<th class="" tabindex="0" aria-controls="example1" rowspan="1" colspan="1" style="width: 119px;align:center;" aria-label="Platform(s): activate to sort column ascending">Delete Category</th>
</tr>
</thead>
<tbody>
<tr role="row" class="even">
<?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
>
<?php echo $row['category_name'];?>
" >EDIT
" onclick='location.reload(true); return true;'>DELETE
<?php } ?>
<?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
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