Reputation: 328
public function delete($query){
$delete_row = $this->link->query($query) or die($this->link->error.__LINE__);
if($delete_row){
return "Data Delete Succes";
exit();
} else {
die("Error :(".$this->link->errno.")".$this->link->error);
}
}
if(isset($_GET['status'])){
if($_GET['status'] == 'delete'){
$id = $_GET['id'];
$deleteUserQuery = "DELETE FROM `admin_info` WHERE id= $id";
$result = $crud->delete($deleteUserQuery);
if(isset($result)){
echo $result;
}
}
}
Upvotes: 1
Views: 592
Reputation: 46
That is by default unless you write a simple code block to automatically refresh the page once the query has executed successfully. You can do this in many ways using php, js etc...
If you are using php, try adding the code block below and change the url to the page name you want the site to redirect
header("Location: url");
Refer the PHP Documentation on the usage of this header
element here https://www.php.net/manual/en/function.header.php
Or use AJAX
Upvotes: 1