Hi! I'm trying to process a date field on a form where the input is m/d/Y and I can't figure out how to have that entered as the appropriate Y-m-d mysql format. I've tried a thousand things, but I'm doing something wrong. And I can't use a dropdown. Users must be able to enter the date in m/d/Y format. Thank you for any help you can offer! Here is the code:
$currentPage = $_SERVER["PHP_SELF"];
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO tbl_timerecords (fd_date, fd_client, fd_task, fd_hours, fd_description, fd_status, fd_notes, fd_user) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['fd_date'],"date"),
GetSQLValueString($_POST['fd_client'], "text"),
GetSQLValueString($_POST['fd_task'], "text"),
GetSQLValueString($_POST['fd_hours'], "double"),
GetSQLValueString($_POST['fd_description'], "text"),
GetSQLValueString($_POST['fd_status'], "text"),
GetSQLValueString($_POST['fd_notes'], "text"),
GetSQLValueString($_POST['fd_user'], "text"));