Results 1 to 2 of 2

Thread: Timestamp not updating automatically

  1. #1

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    17

    Timestamp not updating automatically

    Hello.

    I think ive resolved a problem with a MYSQL table not updating, see this thread:

    http://forum.powweb.com/showthread.php?t=97472

    However, I have a field which i want the timestamp to update whenever a record has been updated (whether it is CHANGED or not) - just when I update it.


    My MYSQl structure says:

    Name: Checked

    Type: timestamp

    Attributes: ON UPDATE CURRENT_TIMESTAMP

    Null: NO

    Default: CURRENT_TIMESTAMP

    Extra: on update CURRENT_TIMESTAMP


    The problem is, my code appears to update a field / record - But the 'Checked' column is not updating to the current date / time.

  2. #2

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    17
    Ps when i use the MYSQLADmin systm - & edit thE STRUCTURE - Im getting errors as well - to try & make a field auto-incrememt with current timestamp.

    latest error (not updated)

    This is using the website :-



    Error
    SQL query:

    ALTER TABLE `Master` CHANGE `Checked` `Checked` TIMESTAMP( 20 ) ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP

    MySQL said: Documentation

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(20) ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP' at line 1

Posting Permissions

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