Date/Time
I feel really stupid for asking this because I feel like the answer is right under my nose, but I just can't seem to understand how to do this.
I am working on a form, and I would like it to automatically record the date and time that the form was submitted, but I can't find the code or whatever to do it.
When the form is submitted, the data is added to a MySQL table, so if there is a way to do it in the MySQL settings or something, that would be great. Thanks.
By the way, I know how to use the date() function, if that's part of it.
Kurtis
chrishirst posted this at 19:10 — 8th October 2005.
He has: 379 posts
Joined: Apr 2005
use the MySQL now() function in the insert query.
INSERT INTO table timefield VALUES(now()) ;
or set the field to a TIMESTAMP type and it will be updated on insert.
Chris
Indifference will be the downfall of mankind, but who cares?
Venue Capacity Monitoring
Code Samples
kazimmerman posted this at 19:18 — 8th October 2005.
He has: 698 posts
Joined: Jul 2005
Thank you. I knew it was right there.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.