Connecting Tech Pros Worldwide Forums | Help | Site Map

mysql doing the date thing on its own

monomaniac21
Guest
 
Posts: n/a
#1: May 17 '06
Hi all can mysql be queried so it finds and then adds the current date
to a field without requiring a php function to get the date for it?


strawberry
Guest
 
Posts: n/a
#2: May 17 '06

re: mysql doing the date thing on its own


Sure, just read up on the UPDATE syntax

ED
Guest
 
Posts: n/a
#3: May 17 '06

re: mysql doing the date thing on its own


"monomaniac21" <mcyi2mr3@googlemail.com> wrote in message
news:1147869686.245426.298350@i40g2000cwc.googlegr oups.com...[color=blue]
> Hi all can mysql be queried so it finds and then adds the current date
> to a field without requiring a php function to get the date for it?
>[/color]

By 'add' I presume you mean just set the current date, in which case:

"UPDATE my_table set my_datefield = CURDATE()";

cheers,
ED


Closed Thread