<?php
header('content-type:application/json');
include($_SERVER['DOCUMENT_ROOT'] . "/API-Others/connection/conn.php");

$stock_id = addslashes(isset($_POST['id']) ? $_POST['id'] : '');

$sql = ("DELETE FROM stocklist WHERE id = '$stock_id'");
if (mysqli_query($conn, $sql)) {
    $statusCode = 200;
    $statusMessage = "User Deleted Successfully";
} else {
    $statusCode = 1042;
    $statusMessage = mysqli_error($conn);
}



$resultData = array('code' => $statusCode, 'message' => $statusMessage);
echo json_encode($resultData);
