|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: May 2000
Location: On some harddisk
Posts: 661
|
Hi guys,
Let's say that I have a table with the following fields: Fields: a (doesn't matter what kind of data type) b (doesn't matter what kind of data type) c timestamp(14) d timestamp(14) Everytime a new record is created, a and b fields are filled up together with the record created time in c. As for d, I'll like to use a script that detects the time at which the script was run and have a timestamp(14) (in other words, "select now()+ 0" query) query run and placed into a certain unique record id (assume that a is unique). Any ideas? |
|
|
|
|
#2 | |
|
SitePoint Callithumpian
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2000
Location: Sydney, Australia
Posts: 3,845
|
There will be time, there will be time. Time for me and time for you...
You should be aware of the unique behaviour of the TIMESTAMP type. From the manual http://www.mysql.com/doc/D/A/DATETIME.html
Quote:
1) Swap the order of columns "c" and "d" if you are to use timestamp for both. Also, your sql snippet "NOW() + 0" could be replaced with just "NOW()" |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 14:30.







Linear Mode
