mysql doing the date thing on its own

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • monomaniac21

    mysql doing the date thing on its own

    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

    #2
    Re: mysql doing the date thing on its own

    Sure, just read up on the UPDATE syntax

    Comment

    • ED

      #3
      Re: mysql doing the date thing on its own

      "monomaniac 21" <mcyi2mr3@googl email.com> wrote in message
      news:1147869686 .245426.298350@ i40g2000cwc.goo glegroups.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


      Comment

      Working...