title: PDO returns empty array as result
body: <p>I have a simple search <code>form</code>, which I use to send a <code>POST</code> request to my php script using AJAX. I want the script to search my database for the keyword in the title column, and return the rows where it finds it. The posted data looks like this <code>"searchword=test1"</code>, where <code>test1</code> in the content of my text input.</p>
  
  <p>I have 2 rows in my database, one has a title of test1, and another of test2. If I do <code>SELECT * FROM articles</code> I can see the results fine. If I type <code>SELECT * FROM articles WHERE title LIKE 'test1';</code> into console, I get the correct result, but my php script returns an empty array.</p>
  
  <p>No idea what I'm doing wrong here, any help is appreciated.</p>
  
  <p>my php:</p>
  
  <pre><code>try {
      $hostname = "localhost";
      $username = "root";
      $password = "";
  
      $db = new PDO("mysql:host=$hostname;dbname=topdecka_PTC",$username, $password);
  
      if (!empty($_POST["searchword"])) {
          $searchword = $_POST["searchword"];
          $query = $db-&gt;prepare("SELECT * FROM articles WHERE title LIKE %:seachword%");
          $query-&gt;execute(array(':searchword' =&gt; $searchword));
  
          $result = $query-&gt;fetchAll(PDO::FETCH_ASSOC);
          echo json_encode($result);
          die();
      } 
      else {
          $query = $db-&gt;prepare('SELECT * FROM articles');
          $query-&gt;execute();
  
          $result = $query-&gt;fetchAll(PDO::FETCH_ASSOC);
          echo json_encode($result);
          die();
      }
  } catch (PDOException $e) {
      echo "Error!: " . $e-&gt;getMessage() . "&lt;br/&gt;";
      die();
  }
  </code></pre>