I have a website where a user clicks a submit button and then a record in my database is updated. I'm trying to make it so that the time and date of when they clicked submit is saved to the database as well however I'm having problems with my query and the database isn't updating. My query is:
$query = (("
UPDATE markers
SET questTitle ='$questTitle',
category='$category',
questReward ='$questReward',
date_submitted =DATE(STR_TO_DATE($date_submitted, '%m/%d/%Y'))
WHERE id = '$id'
"));
I'm getting an error that reads:
failedInvalid query: Incorrect datetime value: '2018-10-26' for function str_to_date
Any help would be appreciated, thank you.