title: mysql php js live search
body: <p>I'm currently doing a live search form based on Jquery/ajax/php, but it dosent seems to work.
  Can you guys se a problem in my code? :)</p>
  
  <pre><code>function getStates(value) {
    $.post("search.php",{ partialState: value }, function(data) { 
      $("#results").html(data);
    });
  }
  
  &lt;input type="text" onkeyup="getStates(this.value)" /&gt;
  &lt;div id="results"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Search.php:</p>
  
  <pre><code>$partialStates = $_POST['partialState'];
  $states = mysql_query("SELECT institution_name FROM sb_institutions WHERE institution_name LIKE '%$partialStates%'");
  
  while($stateArray = mysql_fetch_array($states)) {
      echo "&lt;div&gt;" . $state['institution_name'] . "&lt;/div&gt;";
  }
  </code></pre>
  
  <p>Thanks! :)</p>