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

    $data = array();
$a=1;
//get matched data from skills table
$query = $con->query("SELECT * FROM pkg WHERE pkg_name LIKE '%".$searchTerm."%'");
while ($row = $query->fetch_assoc()) {
	
		$name["id"]=$a++;
		$name["id"] =$row['pkg_id'];
		$name["name"] =$row['pkg_name'];
	    $name["desc"] = $row['pkg_detail'];
		$name["amount"] =$row['pkg_price'];
		$name["date"] =$row['pkg_date'];
			           array_push($data, $name);  
//echo "</br>";			   
//echo json_encode($data);
			   }

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

