Gossamer Forum
Home : Products : Gossamer Links : Discussions :

help updating one links field based on another

Quote Reply
help updating one links field based on another
I'm thinking this is probably mysql 101 stuff so I'm hoping someone can help me out :)

What I need to do is change a field from no to yes but only if another field is empty.

Specifically, if the "Contact Email" field is blank in GLinks3 I want to change "Claimable" from no (0) to yes (1).

Thanks.
Quote Reply
Re: [fantasyman] help updating one links field based on another In reply to
I just realized I probably wasn't clear enough...I want to know how to correctly run a mysql query to do this one time en-mass and correct the entries. Wink
Quote Reply
Re: [fantasyman] help updating one links field based on another In reply to
Try this:

UPDATE glinks_Links SET Claimable = '1' WHERE Contact_Email IS NULL;

Hope that helps.

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] help updating one links field based on another In reply to
Thanks for the right commands Andy. I actually had to use WHERE Contact_Email = '' because the email fields were truly empty which I now know is not the same as NULL.

I love learnin.
Quote Reply
Re: [fantasyman] help updating one links field based on another In reply to
Ah yeah, NULL and "" are different. Glad you worked it out though =)

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!