title: Adding date of birth to database
body: <p>I'm trying to add fields for Day, Month and Year in registration form and add it to user record in database. So I've put this is the form:</p>
  
  <pre><code>&lt;div class="form-group"&gt; 
     &lt;div class="form-inline"&gt;
        &lt;div class="form-group pull-right"&gt;
           &lt;select name="year" id="year" class="form-control"&gt;
              &lt;option value="--" selected&gt;Year&lt;/option&gt;                       
              &lt;?php
                  for($i=date('Y'); $i&gt;1899; $i--) {
                      $birthdayYear = '';
                      $selected = '';
                      if ($birthdayYear == $i) $selected = ' selected="selected"';
                      print('&lt;option value="'.$i.'"'.$selected.'&gt;'.$i.'&lt;/option&gt;'."\n");
                  }
              ?&gt;                          
            &lt;/select&gt;     
        &lt;/div&gt;                    
        &lt;div class="form-group pull-right"&gt;
          &lt;select name="month" id="month" onchange="" class="form-control" size="1"&gt;
              &lt;option value="--" selected&gt;Month&lt;/option&gt;
              &lt;option value="01"&gt;Jan&lt;/option&gt;
                 ...
              &lt;option value="12"&gt;Dec&lt;/option&gt;
          &lt;/select&gt;            
        &lt;/div&gt;                                             
        &lt;div class="form-group pull-right"&gt;
          &lt;select name="day" id="day" onchange="" class="form-control" size="1"&gt;
          &lt;option value="--" selected&gt;Day&lt;/option&gt;
          &lt;option value="01"&gt;01&lt;/option&gt;
                  ...
          &lt;option value="31"&gt;31&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;                                              
  &lt;/div&gt;
  &lt;/div&gt;  
  </code></pre>
  
  <p>Then in the php part this</p>
  
  <pre><code>if(!isset($error)){
  
      //hash the password
      $hashedpassword = $user-&gt;password_hash($_POST['password'], PASSWORD_BCRYPT);
  
      //create the activasion code
      $activasion = md5(uniqid(rand(),true));
      $dateOfBirth = $_POST['day']."-". $_POST['month']."-".$_POST['year'];
  
      try {
          $stmt = $pdo-&gt;prepare('INSERT INTO users (username,password,email,created,active,user_birthday) VALUES (:username, :password, :email, NOW(), :active, :user_birthday)');
  
          $stmt-&gt;execute(array(
              ':username' =&gt; $_POST['username'],
              ':password' =&gt; $hashedpassword,
              ':email' =&gt; $_POST['email'],                
              ':active' =&gt; $activasion,
              ':user_birthday' =&gt; $dateOfBirth
          ));
      ....
  </code></pre>
  
  <p>When I hit register everything is inserted into database but the date is <code>0000-00-00</code>. It doesn't matter what I choose in dropdowns. </p>
  
  <p>The field for <code>user_birthday</code> in database is <code>DATE</code>. Why doesn't save what is selected?</p>