title: PHP Date only won't insert into Mysql
body: <p>I have a HTML form that has ~30 variables being inserted into mysql via php. All the other variables are inserting correctly except for the date. I have looked at many of the other questions posted here and elsewhere and have still come up empty. </p>
  
  <p>Originally I just had 3 inputs on the HTML form (year, month, day) setup as so:</p>
  
  <pre><code>     &lt;span class="form-sub-label-container" style="vertical-align: top"&gt;
          &lt;input class="form-textbox" id="year_6" name="lengthOf[0]" type="date" value="" /&gt;
          &lt;span class="date-separate"&gt; &amp;nbsp;- &lt;/span&gt;
          &lt;label class="form-sub-label" for="year_6" id="sublabel_year" style="min-height: 13px;"&gt; Start Date &lt;/label&gt;
        &lt;/span&gt;
  
       &lt;span class="form-sub-label-container" style="vertical-align: top"&gt;
          &lt;input class="form-textbox" id="month_6" name="lengthOf[1]" type="date" size="2" maxlength="2" value="" /&gt;
          &lt;span class="date-separate"&gt; &amp;nbsp;- &lt;/span&gt;
          &lt;label class="form-sub-label" for="month_6" id="sublabel_month" style="min-height: 13px;"&gt; Month &lt;/label&gt;
        &lt;/span&gt;
  
       &lt;span class="form-sub-label-container" style="vertical-align: top"&gt;
          &lt;input class="form-textbox" id="day_6" name="lengthOf[2]" type="date" size="2" maxlength="2" value="" /&gt;
          &lt;label class="form-sub-label" for="day_6" id="sublabel_day" style="min-height: 13px;"&gt; Day &lt;/label&gt;
        &lt;/span&gt;
  </code></pre>
  
  <p>With the php for this portion being:</p>
  
  <pre><code>$LengthOfService = $_POST['lengthOf'][0]."-".$_POST['lengthOf'][1]."-".$_POST['lengthOf'][2];
  </code></pre>
  
  <p>A <code>print_r($LengthOfService)</code> would show a correctly formatted date yyyy-mm-dd, however in the column that holds the date (it is DATE type) it shows 0000-00-00.</p>
  
  <p>SOOOOO, I then decided to try and change the input type on the HTML form to date so there would only be 1 POST variable to load instead of 3: </p>
  
  <pre><code>          &lt;span class="form-sub-label-container" style="vertical-align: top"&gt;
              &lt;input class="form-textbox" id="year_6" name="lengthOf" type="date" value="01/01/2000" /&gt;
              &lt;label class="form-sub-label" for="year_6" id="sublabel_year" style="min-height: 13px;"&gt; Start Date &lt;/label&gt;
            &lt;/span&gt;
  </code></pre>
  
  <p>so now the php was simply:</p>
  
  <pre><code>$LengthOfService = $_POST['lengthOf'];
  </code></pre>
  
  <p>That was still a no-fire, so kept kept on with the reading and decided to go a head and try to format it even though it seemed to be already formatted correctly.</p>
  
  <pre><code>$LenthOfService = date("Y-m-d", strtotime($_POST['lengthOf']));
  </code></pre>
  
  <p>Still showing up in the mysql column as 0000-00-00, all the while <code>print_r($LengthOfService)</code> still produced the correct format...</p>
  
  <p>Just for reference this is how I'm inserting into mysql:</p>
  
  <pre><code>$insert = "INSERT INTO table (ColumnNames) VALUES ('$Values')";
  
  mysql_query($insert)
     or die (mysql_error());
  </code></pre>
  
  <p>Hopefully I've provided enough information for someone to either be able to tell what I'm doing wrong or any other steps I can try. I'm not getting any errors either.</p>