Changing status of data in database in php mysql
<?php
session_start();
include('includes/config.php');
error_reporting(0);
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
if($_GET['action']=='del' && $_GET['rid'])
{
$id=intval($_GET['rid']);
$query=mysqli_query($con,"update tblcategory set Is_Active='0' where id='$id'");
$msg="Category deleted ";
}
// Code for restore
if($_GET['resid'])
{
$id=intval($_GET['resid']);
$query=mysqli_query($con,"update tblcategory set Is_Active='1' where id='$id'");
$msg="Category restored successfully";
}
// Code for Forever deletionparmdel
if($_GET['action']=='parmdel' && $_GET['rid'])
{
$id=intval($_GET['rid']);
$query=mysqli_query($con,"delete from tblcategory where id='$id'");
$delmsg="Category deleted forever";
}
?>
Comments
Post a Comment