Jump to content


Photo

inserting date and time


  • Please log in to reply
2 replies to this topic

#1 antilectual

antilectual
  • New Members
  • Pip
  • Newbie
  • 2 posts
  • Locationcambridge, uk

Posted 14 November 2003 - 09:58 PM

on my news manager i have been using CURDATE() to insert the date on which a news item was posted, but now i have changed the column from date to datetime (YYYY-MM-DD HH:MM:ss) and curdate() will not enter the time. is there something else i can use? what does timestamp() do?
this is my query at the moment:

"INSERT INTO News SET NewsTitle=\'$title\',                  NewsDate=CURDATE(),                  UserID=$user_id,                  NewsText=\'$text\'";
any ideas?
cheers,
Antilectual

#2 Guest_Weirdan_*

Guest_Weirdan_*
  • Guests

Posted 15 November 2003 - 12:16 AM

insert into sometable set somefield=now()
?

#3 antilectual

antilectual
  • New Members
  • Pip
  • Newbie
  • 2 posts
  • Locationcambridge, uk

Posted 15 November 2003 - 02:32 PM

cheers bud




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users