Jump to content

Archived

This topic is now archived and is closed to further replies.

antilectual

inserting date and time

Recommended Posts

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

Share this post


Link to post
Share on other sites
Guest Weirdan
insert into sometable set somefield=now()

?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.