asunwatcher Posted November 9, 2010 Share Posted November 9, 2010 Hi there, I've just started learning php and mysql today. I'm putting things together in dreamweaver and everything is running smoothly (ish). I've got a form written in php that sends data to a database. All fine. I need to send the time of submission to the database. I've put in a hidden field, what code should I use to set the field value to a mysql field of type DATETIME? Cheers. Quote Link to comment Share on other sites More sharing options...
requinix Posted November 9, 2010 Share Posted November 9, 2010 Unless your web server and database server are in different timezones, use NOW(). It's a MySQL function, not a PHP function. INSERT INTO table (fields...) VALUES (..., NOW(), ...) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.