<?php
include_once('conn.php');
$searchTerm =$_GET['term'];

    $data = array();
$a=1;
//get matched data from skills table
$query = $con->query("SELECT * FROM customer WHERE c_name LIKE '%".$searchTerm."%'");
while ($row = $query->fetch_assoc()) {
	
		$name["id"]=$a++;
	    $name["desc"] = $row['c_fname'];
		$name["code"] =$row['c_id'];
		$name["name"] =$row['c_name'];
		$name["address"] =$row['c_address'];
		$name["cnic"] =$row['c_cnic'];
		$name["conn"] =$row['conn_date'];
		$name["phone1"] =$row['c_phone1'];
		$name["pkg"] =$row['c_pkg'];
		$name["status"] =$row['status'];
	           array_push($data, $name);  
//echo "</br>";			   
//echo json_encode($data);
			   }

//return json data
echo json_encode($data);
?>

