SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2013
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy How to add modified date into database?

    I am new to php.

    I have a record in my database, when i change the record and update, the modified date should automatically get insert into database.

    what are all the steps i need to take?

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    153 Post(s)
    Tagged
    3 Thread(s)
    Use NOW() in your Update statement
    PHP Code:
    UPDATE
        mytable
    SET
         field1 
    'value1'
       
    field2 'value2'
       
    datefield NOW()
    // etc 
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2013
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you so much..

  4. #4
    Non-Member
    Join Date
    Apr 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am also agree.Now() will be used in the update query to display the current date and time.It returns the yyyy-mm-dd and also HH:MI:SS.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •