<?php
header ('Content-Type: application/json');
header('Acess-Control-Allow-Origin: *');
header('Acess-Control-Allow-Methods: Put');



include 'confing.php';

$data=json_decode(file_get_contents("php://input"),true);

$tableName=$data['table'];

$filed_1=$data['filed_1'];
$filed_value_1=$data['filed_value_1'];

$id=$data['id'];

$sql="UPDATE `$tableName` SET `$filed_1` ='$filed_value_1' 
WHERE id = $id";

// echo $sql;


$result=mysqli_query($conn,$sql) or die("error while");


                  

if($result){

    echo json_encode(array('message'=>'category is Update','status'=>'ture'));


}else{

    echo json_encode(array('message'=>'category is not Update','status'=>'false'));

}


?>