title: My jQuery UI Autocomplete not working?
body: <p>Here I am trying to implement the jQuery I have two main files one is db.php which hold this thing:</p>
  
  <pre><code>&lt;?php
  
  $connection = mysql_connect("localhost","root","");
  $db = mysql_select_db("auto",$connection);
  
  $sql = "SELECT * FROM data";
  
  $result = mysql_query($sql,$connection);
  //$arr = array();
  while($row = mysql_fetch_array($result)){
  
  echo $row['name']."\n";
  }
  //echo json_encode($arr);
  
  mysql_close($connection);
  ?&gt;
  </code></pre>
  
  <p>Then I have another file named as index.html in which I am calling jQuery functions:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.8.custom.css"&gt;
  &lt;link rel="stylesheet" type="text/css" href="css/autocomplete.css"&gt;
  &lt;script type="text/javascript" src="js/jquery-1.4.2.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  
  $(document).ready(function(){
      $("#example").autocomplete("db.php");
    });
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  Auto:&lt;input id="example" type="text"&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>but I am unable to run any code can you tell me why? I am newbie to jQuery so apology for mistakes.</p>
  
  <p>P.S: I tried with json encode function because I search and find out it may be reason of Json data (which I was assigning to <code>$arr</code> then echoing the jsonencode) but still its not working.</p>