title: How to insert date into database?
body: <p>I've looked up how to do this but I just can't seem to get it right.  Please tell me how to combine the month, day, and year, into one date to be inserted into the mysql database.  My problem is not actually sending information to the database.  My problem is I'm sending  3 separate fields (month, day, year) to the database. Please instruct me exactly where to put your recommended codes.
  Here's my code:</p>
  
  <pre><code>&lt;?php
  function register_user($register_data) {
  array_walk($register_data, 'array_sanitize');
  
  $fields = '`' . implode('`, `', array_keys($register_data)) . '`';
  $data = '\'' . implode('\', \'', $register_data) . '\'';
  
  mysql_query("INSER INTO `users` ($fields) VALUES ($data)");
  }
  ?&gt;
  
  &lt;form action="" method="post"&gt;
      &lt;ul&gt;
          &lt;li&gt;
              &lt;select name="month"&gt;
                  &lt;option value="01"&gt;January&lt;/option&gt;
                  //all the other month options
              &lt;/select&gt;
              &lt;select name="day"&gt;
                  &lt;option value="01"&gt;1&lt;/option&gt;
                  //all the other days
              &lt;/select
              &lt;select name="year"&gt;
                  &lt;option value="2013"&gt;2013&lt;/option&gt;
                  //more year options
              &lt;/select&gt;
          &lt;/li&gt;    
          &lt;li&gt;
      &lt;input type="submit" name="registrationform" value="Sign up"&gt;
      &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/form&gt;
  
  &lt;?php
  if (empty($_POST) === false &amp;&amp; empty($errors) === true){
      $register_data = array(
          'Month'     =&gt; $_POST['month'],
          'Day'       =&gt; $_POST['day'],
          'Year'      =&gt; $_POST['year']
      );
  
      register_user($register_data);
      //redirect
      exit();
  ?&gt;
  </code></pre>