Jump to content

Recommended Posts

Ok, I did that and it inserted the field on my table with the timestamp of the current time stamp.

so does that mean everytime a new record is created, it will record the time of creation? and how do I go about in calling that value out?

 

much appreciated!

When pulling the data back it will display in unix time format ie 1176857705

 

 

so use this

<?php
$timestamp = row['FieldName']; // <-- pull as normal 
echo date("m/d/y",$timestamp)
?>

 

Oh better point this out

 

Barand

Senile

Super Moderator

Genius

**********

The problem with TIMESTAMP columns is that they will update automatically so if, a few months down the line, you change the value of, say, the name field because of a misspelling, the timestamp field becomes the date of the change and not the original date registered.

 

 

Barand recommand you don't use the 'DEFAULT CURRENT_TIMESTAMP' but instead the following

When you add a record put the MySQL value NOW() into that column.

 

personally i havn't had any problems but he highly likly better than me (at PHP & MySQL atleast)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.