combine or concatenate form fields
My site requires date calculations. I have set all pages that collect dates up to require users to select dates in 3 menu boxes; year, month, and day. So far I have built pages to express this data as needed using the 3 values separated by the text that makes it reader friendly. So far my work has been done in PHP/MySQL.
My databases are set up to receive year, month, day, and DATE (4 different fields); the user only enters 3 values and the 4th should be based on the prior 3. What I would like to do is at the insert or update pages, have the DATE field fill off of the 3 date values entered and insert the "-" at their appropriate points, or concatenate the values to make a valid DATE entry. Within the Insert/Update server behaviors and in the DATE field, here is a sample of one of several field command attempts that so far have failed to post vaild dates in the SQL database:
<?php echo ((isset($_POST["selYearcal1"]. "-" . $_POST["selMonthcal1"] . "-" . $_POST["selDaycal1"]))?$_POST["selYearcal1"]. "-" . $_POST["selMonthcal1"] . "-" . $_POST["selDaycal1"]:""); ?>
Again, I am trying to fill the DATE with a valid date value using the 3 user inputs.
I am learning (by no means skilled) PHP language, can anyone show me the syntax/command to combine form elements and text to create a valid date for database entry?