|
Subject:
|
Creating an auto update date field
|
|
Posted By:
|
tmswenson
|
Post Date:
|
1/3/2006 3:47:01 PM
|
I have a database table that is updated via a web form. How do I create a field in the database table that will automatically enter in the date of the entry, to a field, called "Date"....I am using phpMyAdmin?
|
|
Reply By:
|
anshul
|
Reply Date:
|
1/4/2006 1:32:00 AM
|
Either insert it by getting current time using a PHP function like strftime().
Or create a MySQL field (may be of length 14 chars) applying MySQL built-in timestamp function.
`~@#\^%&*/\.<.\/-|+|_!:;..=?> Students' finances
|
|
Reply By:
|
tmswenson
|
Reply Date:
|
1/4/2006 10:34:50 AM
|
Thanks for the reply.
I would like to use the option of: "Creating a MySQL field and applying the built-in timestamp function.
I am working with MySQL via, phpMyAdmin....
I don't know how to set up the time stamp function. Do you have documentation on that?
|
|
Reply By:
|
anshul
|
Reply Date:
|
1/4/2006 2:12:37 PM
|
quote: I don't know how to set up the time stamp function.
It is as simple as: INSERT into table_name(field1, field2) VALUES('$var1', 'timestamp()')
Note that PHP has no function timestamp(). It is of MySQL.
Use phpMyAdmin to easy manage all these things.
`~@#\^%&*/\.<.\/-|+|_!:;..=?> Students' finances
|