<?php
$connect = mysqli_connect('localhost','root','','erp2016_emam');
$sql = mysqli_query($connect,"SELECT * FROM client WHERE clientname LIKE '%".$_GET['term']."%'");
$rows=array();
while ($row = mysqli_fetch_array($sql)){
    $rows[]=array(
        'id'=>$row['clientid'],
        'text'=>$row['clientname']
    );
}
echo json_encode($rows);
exit;







