desithugg Posted August 5, 2006 Share Posted August 5, 2006 umm i have a field in one of my tables calledfield:postDate type:datetimedefault:0000-00-00 00:00:00umm if i wanna insert time in there using a quesry how can i do so Link to comment https://forums.phpfreaks.com/topic/16666-inserting-time/ Share on other sites More sharing options...
king arthur Posted August 5, 2006 Share Posted August 5, 2006 If you mean the current time you are running the query, use NOW() Link to comment https://forums.phpfreaks.com/topic/16666-inserting-time/#findComment-69975 Share on other sites More sharing options...
desithugg Posted August 5, 2006 Author Share Posted August 5, 2006 o kk thanx Link to comment https://forums.phpfreaks.com/topic/16666-inserting-time/#findComment-69976 Share on other sites More sharing options...
tomfmason Posted August 5, 2006 Share Posted August 5, 2006 You can do it like this.[code=php:0]$sql= mysql_query("INSERT INTO yourtable(postdate) VALUES (now())") or die (mysql_error());[/code] Link to comment https://forums.phpfreaks.com/topic/16666-inserting-time/#findComment-69978 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.