<?php
session_start();
    header('Access-Control-Allow-Origin:*');
    header('Content-Type; application/json; charset=utf-8');
    header('Access-control-Allow-Method: POST');
    header('Access-control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-request-With');
    include('db.php');
        $inputdata = json_decode(file_get_contents("php://input"), true);
        
        $seuil_faible = $inputdata['seuil_faible'];

        $pub=$db->prepare('UPDATE tbl_product SET seuil_faible=?');

        $res=$pub->execute(array($seuil_faible));

        if ($res) {
            // code...
            echo(json_encode(['response' => 1]));
        } else {
            // code...
            echo(json_encode(['response' => 0]));

        }
        
        