<?php
include'connection.php';
$search = $_GET['term'];

$select =mysqli_query($cons, "SELECT * FROM `items` WHERE (`Iname` LIKE '%".$search."%' AND `Status` = '0' AND `Produ`='1') OR (`Descri` LIKE '%".$search."%' AND `Status` = '0' AND `Produ`='1') OR (`items`.`Ecode`='".$search."') ORDER BY `Iname` ASC");
while ($row=mysqli_fetch_array($select)) 
{
 $data[] = $row['Iname'];
}
//return json data
echo json_encode($data);
?>