Jump to content

[SOLVED] Wildcard updates?


Cless

Recommended Posts

With MySQL, is it possible to do a wildcard set? For example, when using search, you can say:

 

SELECT * FROM blah WHERE b_moo LIKE '%2%'

 

...which would select all rows where b_moo has the number 2 in it.

 

I need to do something similar in an UPDATE query, similar to:

 

UPDATE blah SET b_moo='%3%' WHERE b_moo LIKE '%2%'

 

...which I want to replace all instances of the number 2 with 3 (or, atleast, the first instance).

 

Is this possible?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/159471-solved-wildcard-updates/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.