title: Dynamic search php ajax jquery
body: <p>I am doing a simple search from a database with ajax using php. This is front end newSearch.php</p>
  
  <pre><code>            &lt;&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              function getNodes(value){$.post("getNodes.php",{partialNode:value},function(data){
                  $("#results").html(data);
              });
              }
          &lt;/script&gt;
  &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div&gt;
              &lt;input type="text" onkeyup="getNodes(this.value)" placeholder="Search for nodes" /&gt;
              &lt;br /&gt; 
              &lt;div id="results"&gt;&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/body&gt;
  </code></pre>
  
  <p>and getNodes.php</p>
  
  <pre><code>$partialNode = $_POST['partialNode'];
  
   $nodes = mysqli_query("SELECT Node_Name FROM Nodes WHERE Node_Name LIKE '%$partialNode%'");
  
  while($nodesArray = mysqli_fetch_array($nodes)){
  
      echo "&lt;div&gt;".$nodesArray['Node_Name']."&lt;/div&gt;";
  
  }
  
  mysqli_close($con);
  ?&gt;
  </code></pre>
  
  <p>But for some reason I don't get the result from database. I don't think it is because the front end, it might be because the back end. I only have one instance, node1. So I put "n" in the search box but nothing is displayed. I think it is a simple problem but can't see it.</p>
  
  <p>Thanks</p>