Do not update if no value in input or update as NULL to Date field IF empty
Hello,
I have a simple input using Jquery Datepicker, MySQL Date field with a NULL allowed.
Can't get a blank entry to leave the NULL or Update as NULL when no data / values is selected / present.
Tried:
$UpdateQuery->bindColumn("birthday", "t", "".((isset($_POST["datepicker"]))?$_POST["datepicker"]:"") ."", NULL);
$UpdateQuery->bindColumn("birthday", "t", "".((isset($_POST["datepicker"]))?$_POST["datepicker"]:"") ."", "WA_IGNORE");
$UpdateQuery->bindColumn("birthday", "t", "".((isset($_POST["datepicker"]))?$_POST["datepicker"]:"") ."", "WA_NULL");
Everytime the DB sets "1969-12-31" as the value when the field is empty.
Anyway to leave the Default NULL alone unless there really is a value being set?