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?
Aug 7, 2010, 7:00 AM
Veteran / Moderator (18436 posts)
Aug 7, 2010, 7:00 AM
Post #2 of 5
Views: 11354
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!
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!
Aug 7, 2010, 7:51 AM
Enthusiast (661 posts)
Aug 7, 2010, 7:51 AM
Post #3 of 5
Views: 11376
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!
Aug 7, 2010, 7:53 AM
Veteran / Moderator (18436 posts)
Aug 7, 2010, 7:53 AM
Post #4 of 5
Views: 11355
heheh as long as it works - don't moan :D (I know I dont when something suddenly starts working
)
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!

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!