javascript - Jquery ui autocomplete php retrieve names -
I am trying to use the jquery UI auto-complete widget to retrieve names in a php file (NameSearch .php)
This result is not recovering properly. Is there something wrong with jazzery? Should the ID return the result to the input with the 'tag'?
I'm getting the '$ _GET [' word ']' variable in the PHP file, which I think is sent from the complete request to the php file?
This is the Jquery code I have:
& lt; Script & gt; $ ("# Tag") Autocomplete ({source: "nameSearch.php", Minlang: 2}); & Lt; / Script & gt; php
& lt ;? Php $ namePart = $ _ GET ['word']; $ Names = array (); // Make connections $ con = mysqli_connect ('localhost', 'root', 'admin', 'moviedatabase'); // Query Database $ result = mysqli_query ($ con, "name like selector name, name like '%'. $ NamePart."% '"); $ Arr =' '; while ($ line = mysqli_fetch_array ($ result }} {Array_push ($ name, $ line ['name']);} echo json_encode ($ name);? & Gt; thanks for your help < / Div>
add $ (document) .ready (function () {....});? Solving the problem as a cover
Comments
Post a Comment