Welcome Guest, Not a member yet? Register   Sign In
how to insert a current_timestamp when an update is performed.
#5

[eluser]CroNiX[/eluser]
I'd check what jmadsen said. It's better for this to just be in your table definition. Then you never have to tell it to update, it just will whenever the record updates.

Code:
fieldname timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
This will create the timestamp when a record is created and also update it whenever the record updates.


Messages In This Thread
how to insert a current_timestamp when an update is performed. - by El Forum - 06-21-2012, 09:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB