Gossamer Forum
Home : General : Databases and SQL :

problem with timestamp

Quote Reply
problem with timestamp
the first field in my table is a timestamp which i want automatically filled with current date/time when i add a new record, as well as modify existing record. the modify works fine, but add fills with 0s. add works ok until i use the Resync Database function in Admin. this changes default to CURRENT_TIMESTAMP and changes NOT NULL to NO. when i have NOT NULL = YES and blank default value, it works. why does resync change these properties and is there something i can put in default that will work?
Quote Reply
Re: [delicia] problem with timestamp In reply to
As a default, try NOW() .. this should put the current timestamp in there.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] problem with timestamp In reply to
this is so weird to me! ok, i changed not null to YES and put now() in default. it still filled with 0000-00.... when i added a record. then i did resync database. it changed column properties not null to NO and default value to 0000-00-00.... but now it works. i don't understand, but it works. thanks!
Quote Reply
Re: [delicia] problem with timestamp In reply to
heheh as long as it works - don't moan :D (I know I dont when something suddenly starts working Wink)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] problem with timestamp In reply to
i agree! while you're here, want to take a look at the DBMan SQL forum??? :)