NOW() in UPDATE query?

Codes here !

Moderators: egami, macek, gesf

Post Reply
fredws
New php-forum User
New php-forum User
Posts: 14
Joined: Wed Jul 16, 2003 4:16 pm

Sat Aug 23, 2003 3:07 pm

Can you use NOW() in an update query? I am trying it, but not having much luck, it seems to be setting the value to "NOW()" instead of the actual date and time.

TIA,
Fred
User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Sat Aug 23, 2003 5:22 pm

NOW() works fine in UPDATEs:

Code: Select all

UPDATE table1 SET time = NOW();
Just remember not to put NOW() in quotation marks or anything.
Image
fredws
New php-forum User
New php-forum User
Posts: 14
Joined: Wed Jul 16, 2003 4:16 pm

Sat Aug 23, 2003 6:02 pm

Thanks! I had forgotten and put the quotes in there!
sigix
php-forum GURU
php-forum GURU
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Mon Aug 25, 2003 2:40 am

single qoutes means put the data as it is
'now()' = now()
now()= data...(now)
Post Reply