<?php

$response = array();

// include db connect class
require_once __DIR__ . '/db_config.php';

    
// check for required fields
if (isset($_POST['data']))  {
    
$json=json_decode($_POST['data'],true);

$mail= $json['mail'];
$cname=$json["cname"];
$role=$json["role"];

$name=$json["name"];
$des=$json["des"];
date_default_timezone_set('Asia/Calcutta');
$dt=date('Y-m-d H:i:s');
$id=$json["id"];

$con = mysqli_connect(DB_SERVER, DB_USER, DB_PASSWORD,DB_DATABASE) or die(mysql_error());


$query="UPDATE task_category SET task_categoryname='$name',cat_description='$des' WHERE cat_id='$id'";
    $response["s"]=mysqli_query($con,$query);
    mysqli_close($con);
} 
    echo json_encode($response);

?>