When you have 5 dropdowns for date selection (Y, m,d, H,i) how do you insert the selected date and time into a single column of a mySQL table as a datetime using PHP5?
I know they need to be combined in a string such as:
$DateTime="$Year-$Month-$Day $Hour:$Minute:00";
and then maybe use strtotime:
$Date=date('Y-m-d H:i:s', strtotime($DateTime)) ;
but where do I declare the variables and how do I build it into a query such as:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "details")) {
$insertSQL = sprintf("INSERT INTO sessions (Location1, Location2, Date)
VALUES (%s, %s, $s)",
GetSQLValueString($_POST['Location1'], "text"),
GetSQLValueString($_POST['Location2'], "text"),
GetSQLValueString($_POST[' ???? '], "date"));