title: DateTime defaulting to 1970-01-01
body: <p>I am writing a PHP form for my website. The HTML side asks the user for a date which they enter in MM/DD/YYYY format. When that string is sent to PHP the following code changes it to the form that MySQL will recognize</p>
  
  <pre><code>$date = $_POST['date'];
  $sqldate = date('Y-m-d', strtotime($date));
  </code></pre>
  
  <p>However when that date is entered into my MySQL database it is entered as 1970-01-01 and I can't figure out why.</p>
  
  <p>NOTE: If I echo $sqldate I get the error Use of undefined constant sqldate - assumed 'sqldate' in C:/MYDIRECTORY</p>