Rother2005 Posted January 15, 2007 Share Posted January 15, 2007 is it poss to get todays date to be inserted into a field on the database when a user presses submit e.g. makes a order so details need to go into the database about the order and then a date is inculded? Link to comment https://forums.phpfreaks.com/topic/34289-autodate-inserting/ Share on other sites More sharing options...
Jessica Posted January 15, 2007 Share Posted January 15, 2007 NOW() is the command for mysql current time on a DATE or DATETIME. Or you could use time() in php if the fieldtype is an INT Link to comment https://forums.phpfreaks.com/topic/34289-autodate-inserting/#findComment-161290 Share on other sites More sharing options...
Rother2005 Posted January 15, 2007 Author Share Posted January 15, 2007 so then for example[code]if(!$_POST['register']){FORM}else{$sql = "INSERT INTO member(date)VALUES ('now()')";mysql_query($sql) or die(mysql_error());echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=members.php\"/>Thank You! You will be redirected");}[/code]is that on the right track? Link to comment https://forums.phpfreaks.com/topic/34289-autodate-inserting/#findComment-161322 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.