I have a form that receives the "from" field for the flight:
< Code> & lt; P & gt; & Lt; Label & gt; & Lt; / Labels & gt; & Lt; Input type = 'text' name = 'nerene' value = '' class = 'auto' id = "1" & gt; & Lt; / P & gt;And I have the autocomplete method:
$ return_arr = array ();
if ($ conn) {$ ac_term = "%" Get $ _ ['word'] "%"; $ Query = "SELECT table2.CityName, table2.CountryName, table2.AirportName from Table 2 where CityName: word"; $ Result = $ conn- & gt; Ready ($ query); $ Result-> BindValue (": word", $ ac_term); $ Result-> Executed (); / * Retrieve and store results in the query. For $ / ($ i = 0; $ i & lt; 3; $ i ++) {if (get $ line = $ result-> (PDO: FETCH_ASSOC)) {Array_push ($ return_arr, array ( 'Label' = & gt; $ line ['cityname'], 'value' = & gt; $ line ['citcode'])); Array_push ($ return_arr, array ('label' = & gt; $ row ['CityName'] + "" + $ row ['AirportName'], 'value' = & gt; $ line ['citcode'])); }}
This code works fine when I exclude the + $ line ['airportname'] but as a dummy example to auto-complete it Want to show: Athens, Athens Airport
Row names, connections are all right How can I do this?
Thanks
In PHP, this
. , No
+ . The line ['airportname'], 'line', 'array_push' ($ return_arr, array ('labels' = & gt; $ line ['cityname']]. "" $ Line ['airportname'], '' lang-php prettyprint-override " Value '= & gt; $ line [' citcode ']));
No comments:
Post a Comment