title: MySql - autocomplete
body: <p>I am creating an Ajax autocomplete application and would like know if there is an SQL query I can use for this purpose - e.g if someone types "p" I would like to retrieve all words beginning with "p", if they add "e" retrieve all words starting with "pe" - and continue like that.</p>
  
  <p>Someone suggested the query below but I don't think it's what I'm looking for:</p>
  
  <pre><code>$query = "SELECT* FROM nametable WHERE names LIKE '$partialstring' ";
  </code></pre>