title: How to use new Jqueryui Autocomplete with PHP+MySQL in a SIMPLE way
body: <p>I have searched almost a month everyday for this. In some cases they use the $.ajax way, in others the $.post way. In jqueryui demo page for autocomplete <a href="http://jqueryui.com/demos/autocomplete/" rel="nofollow noreferrer">http://jqueryui.com/demos/autocomplete/</a> you can see they have a simple understandable way of grabbing the data to show it to the user. Now here comes my problem. Am trying to do a simple, short way of grabbing a list of names from a mysql table. this is what i have right now:</p>
  <p>JS</p>
  <p>$(&quot;#usuario&quot;).autocomplete({
  source: &quot;search.php&quot;,
  minLength: 3,
  select: function( event, ui ) {}
  });</p>
  <p>PHP</p>
  <blockquote>
  <p>$nameser = $_POST['usuario'];</p>
  <p>$names = '';</p>
  <p>$result = mysql_query(&quot;SELECT name FROM characters WHERE name LIKE '%$nameser%'&quot;);</p>
  <p>while ($row = mysql_fetch_array($result)) { $names .= &quot;$row[name]&quot;.&quot;<br/>&quot;; }</p>
  <p>echo $names;</p>
  </blockquote>
  <p>if i send info from the input box to php it returns the search pattern answer correctly But how do i attach the returned information to the autocomplete in a simple way.</p>
  <p>The jquery documentation does not provide a simple way of doing it to a php remote file.</p>