title: Mysql not returning expected results
body: <p>I've tried so many different variations of this, I can't figure out why this isn't returning my expected results.  Here's my code as it is now.  I've tried many variations of the variable in the SQL statement after the LIKE and nothing has returned an array as expected.  I've also verified that the $search variable does have the correct string in it.</p>
  
  <p>index.php action switch (this works correctly):</p>
  
  <pre><code>case 'search_result':
      $search = filter_input(INPUT_POST, 'searchBar');
      $results = search_books($search);
      if($results == NULL){
          include('/view/search_null.php');
      }else {
          include('/view/search_results.php');
      }
      break; 
  </code></pre>
  
  <p>My db search function:</p>
  
  <pre><code>function search_books($search_word){
  global $db;
  $query = ' SELECT * FROM books
             WHERE bookTitle LIKE :search_word  ';
  $statement = $db-&gt;prepare($query);
  $statement-&gt;bindValue(":search_word", $search_word);
  $statement-&gt;execute();
  $results_search = $statement-&gt;fetchAll();
  $statement-&gt;closeCursor();
  return ($results_search);
  }
  </code></pre>
  
  <p>Every time $results is NULL and kicks me to my page that returns no results, even if it should return results.  On that page I verify that $search has the correct word in it and that the array size of $results and $results_search is 0.</p>
  
  <p>(Yes I know I should be cleansing the $search, this isn't going live it's just for an assignment)</p>