<?php
 
include 'dbconfig.php';
 
// Create connection

 
$item_code=$_POST['itemcode'];
 

//echo $notrans;
 
$conn = mysqli_connect($servername, $username, $password, $dbname);
 
// Check connection
 
if (!$conn) {
 
    die("Connection failed: " . mysqli_connect_error());
 
}

 

$sql1="SELECT idno, item_code,name_file FROM tbpict where item_code='$item_code' order by name_file asc";
$item1=mysqli_query($conn,$sql1);
 
 
 

$repsonse=mysqli_query($conn,$sql1) or die('Error Queryy'.$sql1);

$items=array();
if (mysqli_num_rows($item1)>0)
{
    while($row=mysqli_fetch_object($item1))
    {
        array_push($items,$row);
        $result['data']=$items;
    }
    
}
 
echo json_encode($result);
 
 
 
mysqli_close($conn);
 
?>