SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot DigitalCreation's Avatar
    Join Date
    Jun 2002
    Location
    'down under'
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Basic MySQL question

    I'm pretty new to mysql, .. ok, .. very new, when inserting a record I'm wanting the mysql to automatically add the time it was updated. Using Now() in access would do this,. but when I add the now() default to the default ( using mysql front) it throws up the 0000-00-00 00:00:00 and when I add and retrive the date, . obviously I don't get anything.. should I be using something other than Now()?

    D.C.

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use a "Timestamp" field, the time will be automatically added or updated whenever you insert or update the record.
    ----Adopt-a-Sig----
    Your message here!

  3. #3
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use UNIX_TIMESTAMP() instead you get a number similar to this 1036548245. It doesn't look great...actually means number of seconds since midnight, January 1st, 1970. But it's raw data that you can later use for whatever format or use you might find for it...just my recommendation.

    Aaron
    Aaron Brazell
    Technosailor




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
  •