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. Link to comment https://forums.phpfreaks.com/topic/218235-simple-question-passing-current-date-to-mysql/ 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(), ...) Link to comment https://forums.phpfreaks.com/topic/218235-simple-question-passing-current-date-to-mysql/#findComment-1132404 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.