Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to insert a field into existing categories with some default value?

Quote Reply
How to insert a field into existing categories with some default value?
How to insert a field into existing categories with some default value kind of "default value xyz"?

I've tried:

Category > Properties > Add Column > Column Name = Extra > Not Null = YES > Default = default value xyz > Form Type = TEXT ... etc.

but I can't see only a new field, "Extra" in all existing categories without "default value xyz"?

Any suggestion? Thanks in advance.
Quote Reply
Re: [katakombe] How to insert a field into existing categories with some default value? In reply to
Hi,

Existing categories won't be updated with the "default"

You need to run a query.

Something like (be sure to backup your DB first, in case it doesn't do what you want :P)

UPDATE glinks_Category SET New_Field = 'bla' WHERE New_Field IS NULL;

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] How to insert a field into existing categories with some default value? In reply to
Hello Andy!

He he ... It worked! (as usual Wink)

Many thanks again Andy!
Quote Reply
Re: [katakombe] How to insert a field into existing categories with some default value? In reply to
The only thing I've noticed is that I must add a description in Description field if I want to change some other, standard Category field, but that's not a big problem ..