Jump to content

joepetrini

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

joepetrini's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. joepetrini

    Timestamp

    If your using mysql 5 you can use a trigger to get fine grain control of record updates. The following will ensure that a timestamp field will not be changed on every update. You could of course use mysql date format in there as well. [code] CREATE TRIGGER test_trg BEFORE UPDATE ON sometable FOR EACH ROW set new.created_at = old.created_at; [/code] Full example: [a href=\"http://www.codedumpster.com/sql/mysql5_timestamps\" target=\"_blank\"]http://www.codedumpster.com/sql/mysql5_timestamps[/a]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.