INSERT/UPDATE form - how to combine 5 form fields to submit to one database field? Datetime
I have drop down menus for day, month, year, hours and minutes to allow users to submit events to an events database table.
In our MySQLi Insert code we currently have the following for the datetime field insert using one of the drop down fields (year):
$InsertQuery->bindColumn("SMTeventdate", "t", "".((isset($_POST["SMTeventyear"]))?$_POST["SMTeventyear"]:"") ."", "WA_DEFAULT");
Is it possible to combine all 5 of our form fields for insertion into this one datetime field (SMTeventdate)? I need to submit in the following format:
I know I need to combine the fields into one 'array' (is it?), but I'm not sure whether I have to do that before submitting the form (onchange event?) or whether it's possible to have the INSERT code handle all five form fields for submission into the one form field.
Also, how would this code change for an UPDATE form?