Hi,
I need to get users to input a date in a way that mysql will recognise so I can make a script to delete records once the date has passed.
So on my form I have 3 dropdown menus with dd / mm / yyyy for the user to select the date - how do I input this so it will be in the correct mysql DATE format?
Anyone got any suggestions?
Thanks!
Use a quick function to re-format the date:
function date_format($day, $month, year) { return $year . "-" . $month . "-" . $day; }
Just make sure that the month and day are padded with zeroes (i.e. 1st March looks like 01/03/2005).
make sure to run the user input thru [man]checkdate[/man] first