Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Need assistance with a mysql statement.

Quote Reply
Need assistance with a mysql statement.
Hello,

I need a little assistance to write a mysql statement (command?) that will search through a mysql table named allcards, find any instance of the words TRUE in the "isred" field and replace them with {R}


Is there such a thing to do that? Or would the MysqlMon (MysqlMan?) program with Links allow me to do that?

Thanks,

Last edited by:

Westin: May 27, 2009, 11:58 PM
Quote Reply
Re: [Westin] Need assistance with a mysql statement. In reply to
So in the "allcards" table, you want to replace "TRUE" with {R}, in the "isred" field? If so, this should work:

UPDATE allcards SET isred = REPLACE(isred,"TRUE","{R}") WHERE isred LIKE '%TRUE%'

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] Need assistance with a mysql statement. In reply to
Thanks Andy,

One more thing in that same field some values are FALSE. If I want to replace FALSE with nothing could I also use this statement:

UPDATE allcards SET isred = REPLACE(isred,"FALSE","") WHERE isred LIKE '%FALSE%'

Last edited by:

Westin: May 28, 2009, 12:11 AM
Quote Reply
Re: [Westin] Need assistance with a mysql statement. In reply to
Yup, that should work.

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!