title: PHP Form Searching MySQL Database
body: <p>currently working on a search form and it's going great, however it's not picking up any of the results successfully.</p>
  
  <p>Here's a screenshot of the database</p>
  
  <p><a href="http://screensnapr.com/e/IdNs9j.png" rel="nofollow">http://screensnapr.com/e/IdNs9j.png</a></p>
  
  <p>As you can see there are several results with the word "dragon"</p>
  
  <p>Now if you go to search.php?name=dragon it brings up these results:</p>
  
  <pre><code>Results
  
  Sorry, your search: dragon returned zero results
  
  You searched for: dragon
  
  Results
  End of results
  </code></pre>
  
  <p>Here's the search query:</p>
  
  <pre><code>$searchTerm = trim($_GET['search']);
  $query = "select * from item where name like '$searchTerm' order by name";
  $numresults=mysql_query($query);
  $numrows=mysql_num_rows($numresults);
  if ($numrows == 0) {
  echo "&lt;h4&gt;Results&lt;/h4&gt;";
  echo "&lt;p&gt;Sorry, your search: " . $searchTerm . " returned zero results&lt;/p&gt;";
  }
  </code></pre>
  
  <p>Why is it not displaying any of the results? Any help would be appreciated.</p>