PHP Mysql PDO retrieve records by date range
<p>I'm retrieving a list of items from my database using the PDO approach and when I do:</p>

<pre class="lang-php prettyprint-override"><code>$select['from'] = date('Y-m-d 00:00:00',strtotime("2016-02-01"));
$sql = "SELECT * FROM listings WHERE date_added &gt;= :date AND date_added &lt; DATE_ADD(:date, INTERVAL 30 DAY)";
$statement = $pdo-&gt;prepare($sql);
$statement-&gt;bindParam(":date", $select['from'], PDO::PARAM_STR);
$statement-&gt;execute();
</code></pre>

<p>var_dump of my result gives:</p>

<pre><code>object(stdClass)#5 (2) { ["data"]=&gt; array(0) { } ["rows"]=&gt; int(0) }
</code></pre>

<p>Running the same query directly through PhpMyAdmin gives the desired result. <code>date_added</code> is data type <code>DATETIME</code> </p>