The documentation for jQuery UI Autocomplete states that the source
property can be set to a URL that returns the suggested items in JSON format. However, it doesn
using firebug we can see this format for json
[{"id":"Podiceps nigricollis","label":"Black-necked Grebe","value":"Black-necked Grebe"}]
I used json_encode
$a[$x] = array("id" => $row["id"],"label"=>$row["label"],"value"=>$row["value"]);
}
//echo JSON to page
$response = json_encode($a);
echo $response;