<?php 

include "../../config/database.php";

if(isset($_POST['field']) && isset($_POST['value']) && isset($_POST['id'])){
    $field = mysqli_real_escape_string($mysqli,$_POST['field']); 
    $value = mysqli_real_escape_string($mysqli,$_POST['value']); 
    $editid = mysqli_real_escape_string($mysqli,$_POST['id']);
    
    $query = "UPDATE jualdetail SET ".$field."='".$value."' WHERE id=".$editid;
    mysqli_query($mysqli,$query);
    
    echo 1;
}else{
    echo 0;
}

exit;