title: Create mysql compatible Date from variables in PHP
body: <p>I have a field set to type <code>date</code> in a mysql table. I get day, month and year from user and at the moment I have the values returned like this:</p>
  
  <pre><code>[start_dateMonth] =&gt; 08 //$stardMonth
  [start_dateDay] =&gt; 7 //$startDay
  [start_dateYear] =&gt; 2013 //$startYear
  </code></pre>
  
  <p>How can I convert this to a valid date that I can easily insert in the database?</p>
  
  <p>This is my own code, but for some reasons the browser just shows a blank screen with no source code inside:</p>
  
  <pre><code>$format = 'Y-m-d H:i:s';
  $start = DateTime::createFromFormat($format, "$startYear-$startMonth-$startDay $startHour:$startMinutes:00");
  
  echo $start;
  </code></pre>