I\'m trying to create an auto-complete function into a textbox but the result should come from my SQL database.
Here\'s the code that i\'m trying to configure:
<
When a string is used, the Autocomplete plugin expects that string to point to a URL resource that will return JSON data.
source: "autocomplete.php"
Therefore you need to return a JSON object.
$json = false;
while($row=mysqli_fetch_array($result))
{
$json[] = array(
'name' => $row['name']
);
}
echo json_encode($json);