<?php   include_once('config/db.php');  // include_once('config/check.php'); 


if(isset($_POST["rawmat"]))
    {    
         $id = $_POST['rawmat'];             
          
          $stmt = $conn->prepare("SELECT * FROM pitem  WHERE id=:i   ");
          $stmt->execute(['i'=>$id ]); 
          $row = $stmt->fetch();  //extract($row);
     
            
            $data["cost"] = $row["cost"];
             
        
    }

 echo json_encode($data);
?>
