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

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