jquery - How to use new Jqueryui Autocomplete with PHP+MySQL in a SIMPLE way -


i have searched month everyday this. in cases use $.ajax way, in others $.post way. in jqueryui demo page autocomplete http://jqueryui.com/demos/autocomplete/ can see have simple understandable way of grabbing data show user. here comes problem. trying simple, short way of grabbing list of names mysql table. have right now:

js

$("#usuario").autocomplete({ source: "search.php", minlength: 3, select: function( event, ui ) {} });

php

$nameser = $_post['usuario'];

$names = '';

$result = mysql_query("select name characters name '%$nameser%'");

while ($row = mysql_fetch_array($result)) { $names .= "$row[name]"."
"; }

echo $names;

if send info input box php returns search pattern answer correctly how attach returned information autocomplete in simple way.

the jquery documentation not provide simple way of doing php remote file.

if searched month , haven't find must kind of miracle searched 2 seconds find plenty of results

http://www.ajaxdaddy.com/demo-jquery-autocomplete.html

http://www.exploremyblog.com/html/blog_contents.php?blogid=300

http://www.thewhyandthehow.com/jquery-autocomplete/

there millions of them code this

  $(document).ready(function(){     $("#example").autocomplete("./search.php");   }); 

try it

$nameser = $_get['q'];  $names = '';  $result = mysql_query("select name characters name '%".$nameser."%'");  while ($row = mysql_fetch_array($result)) { $names .= $row[name]."\n"; }  echo $names; 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -