title: Using a passed variable in a query using PDO
body: <p>I am trying to take a variable passed from another page and use it in a PDO query.  The variable is the date the record was added and I'm trying to return all the newer records.  Do I use $_POST for this in PDO?</p>
  
  <pre><code>&lt;?php
  require_once('globals.php');
  
  $date_added = $_POST['date_added'];
  
  $sth = $dbh-&gt;prepare("SELECT * FROM games WHERE date_added &gt; $date_added");
  $sth-&gt;execute();
  
  /* Fetch all of the remaining rows in the result set */
  print("Fetch all of the remaining rows in the result set:\n");
  $result = $sth-&gt;fetchAll();
  print_r($result);
  
  
  ?&gt;
  </code></pre>