PHP DateTime errors
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2973202/mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given-in-select">mysql_fetch_array() expects parameter 1 to be resource, boolean given in select</a>  </p>
</blockquote>



<p>I have the following code:</p>

<pre><code>print_r($_POST);
$today2 = date("Y-m-d");
$datetime1 = date_create($today2);
$date4 = date_create_from_format('Y-m-d', '$_POST[Bday]');
$interval = date_diff(date_format($date4, 'Y-m-d'), $datetime1);
echo $interval-&gt;format('%R%Y Yrs');
$_POST['Age']= $interval-&gt;format('%R%Y Yrs');
</code></pre>

<p>This is $_POST Array ( [Fname] => tgyuh [Lname] => hjuokl [Phone] => 123-456-1234 [Height] => 60 [Bday] => 1942-08-07 [Sex] => 0 [Hx] => [Age])</p>

<p>I receive the following error messages:</p>

<p>Warning: date_format() expects parameter 1 to be DateTime, boolean given in /var/www/new-pt-data-entry.php </p>

<p>Warning: date_diff() expects parameter 1 to be DateTime, boolean given in /var/www/new-pt-data-entry.php </p>

<p>Call to a member function format() on a non-object in /var/www/new-pt-data-entry.php on line 93 
This error refers to the following code:</p>

<pre><code>echo $interval-&gt;format('%R%Y Yrs');
</code></pre>
