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


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] 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


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