SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    check last update time in mysql

    hi,
    how can i check the timestamp of the last update or changed in a particular row in mysql ?

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can't unless you have specifically created a lastModified column which you update whenever a change is made.

  3. #3
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to have a column in your table that has 'on update' CURRENT_TIMESTAMP
    This is how to add this to your existing table:
    ALTER TABLE `YOUR_TABLE` ADD `current_ts` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL
    Execute this sql and your will have the value current_ts updated when the row is updated
    Just replace 'YOUR_TABLE' with the name of actual table

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks alot


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
  •