|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
stop timestamp updating
I have a database where a timestamp is recorded once an item is added, but when i edit, the timestamp auto updates. I don't want it to do this, I want the timestamp to stay as it was before i edited (so i effectively have recorded when it was first put into the database). Is there someway to do this? the only way i can think of is to call the timestamp, set it as a variable such as $timestamp and run the update sql string with the value inserted into the timestamp field $timestamp, is there a better way?
|
|
#2
|
|||
|
|||
|
RE: stop timestamp updating
How is the time stamp auto updating itself? If it is using a trigger, then you must disable the trigger. If you do ityour way, I think it won't help.
|
|
#3
|
|||
|
|||
|
RE: stop timestamp updating
I don't think there is a better way. The timestamp is designed to change to the current time on insert or update unless you specify a value for it, so that is what you would have to do, just like you described.
|
|
#4
|
|||
|
|||
|
RE: stop timestamp updating
In this case I suggest not to use generic timestamp (I suppose you use it).
Just use datetime collumn and insert with getdate() (or similar function in you db) when you need to timestamp a row. |
|
#5
|
|||
|
|||
|
RE: stop timestamp updating
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > stop timestamp updating |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|