MYSqli Date format glitching on insert
I am doing this with the "t" however it is not inserting the correct data value into the mysql table. I get 1969-12-31 ...
The form variable data has 2023-01-29
$InsertQuery->bindColumn("Event", "t", "".((isset($_POST["Event"]))?$_POST["Event"]:"") ."", "WA_DEFAULT");
any thoughts?
$InsertQuery->bindColumn("date", "s", "".((isset($_POST["date"]))?$_POST["date"]):"") ."", "WA_DEFAULT");
to this:
$InsertQuery->bindColumn("date", "t", "".((isset($_POST["date"]))?$_POST["date"]):"") ."", "WA_DEFAULT");
"s" is for "string" and "t" is for "time".... If you use the correct data type it will automatically convert the date to the correct format to work with mySQL.