Copy link to clipboard
Copied
I'm trying to automatically input the registration date of a customer into my MySQL DB. Nothing seems to work. I've tried timestamp in a table field, I've tried a hidden field in the form. Any suggestions?
Copy link to clipboard
Copied
When defining your table in MySQL, use a TIMESTAMP column. MySQL stores all dates, including timestamps in the format YYYY-MM-DD HH:MM:SS. If you are trying to insert the date in any other format, MySQL won't accept it, and converts it to 0000-00-00 00:00:00
Copy link to clipboard
Copied
You can use NOW() in the insertion record code, it will display like a time stamp format (date + time). Otherwise u can use this if u just want to store the date, $today = date("j F Y "); . It will display like 21 May 2009. Further information about date() function you can get it HERE.