<?php
$term=$_POST['q'];
require_once "config.php";
$sql="select * from customer_details where customer_name like '%".$term."%'";
$query=mysqli_query($con,$sql);
$data=array();
while($result=mysqli_fetch_array($query)){
 $data[]=array(
     
     "label"=>$result['customer_name'],
      "value"=>$result['customer_name'],
     "adr1"=>$result['adr1'],
         "adr2"=>$result['adr2'],
       "gst"=>$result['gst_no'],
          "email_id"=>$result['email_id'],
       "msisdn"=>$result['msisdn'],
           "adr3"=>$result['adr3']
 
         );
 
}
echo json_encode(
       $data
        );
?>