Hi!
I have not used sqlite yet, but with mysql the following table setup works:
CREATE TABLE IF NOT EXISTS actions (int id,...., pTime TIMESTAMP ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
CREATE TABLE IF NOT EXISTS actions (int id,...., pTime TIMESTAMP ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
To copy to clipboard, switch view to plain text mode
On insert/update you never explicitly set the value for pTime. That way it it gets the default value, which is the current_timestamp.. As bonus, that way the timestamp will be the database servers time and not the client time..
According to this http://www.sqlite.org/lang_createtable.html this syntax should be available in sqlite, too.
HIH
Johannes
Bookmarks