search.php
$term = trim(strip_tags($_REQUEST['term']));
$query = "SELECT id, name from employees WHERE first_name LIKE '%$term%'";
$return_arr = array();
$result = mysql_query($query,$db);
while($row = mysql_fetch_array($result)) {
$return_arr[] = array("value"=>$row['id'],"label"=>$row['name']);
}
echo $jsonResponse = json_encode($return_arr);
flush();
?>
For local data with out mysql autocomplete