Autocomplete : how to use mysql data ?
in Using jQuery UI
•
9 years ago
Hello,
Thanks for your tutorial, it seems really helpful to a lot of people but what I need is even a way more basic.
I want to use the autocomplete with data from my mysql db. I created a source list with a php script, this way :
$req=$bd->req_exe("select bandname from groupe where bandname like 'b%' order by bandname");
while ($datagroupes=$bd->objetSuiv($req))
{
$groupes[] = no_accent(stripslashes($datagroupes->bandname));
}
$groupes=json_encode($groupes);
echo $groupes;
The json list seems ok : http://www.shootmeagain.com/groupes.php
But I’m having trouble in my form code, deleting and coding and deleting again because it doesn’t work. In face it shows my data but does NOT filter from what I type in my input.
<script> $(function() { $( "#tags" ).autocomplete({ source: "http://192.168.1.70/shootmeagain/groupes.php", minLength: 1 }); });</script><label for='tags'>Tags: </label><input id='tags'>I realize that I don’t pass any parameter to my groupes.php script, I think that’s why nothing filters. But I can’t get it working.
Please, if someone could help me ?
Thanks a lot !
Erik
1