The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Search and replace on a MySQL table?
Is it possible to make phpMyAdmin, or something else to do a search and replace on some text in a database...
You see, I want it to look at my vB database, go into the smilie table, then find anything that says http://www.consoleradar.com/forums/ and replace it with nothing, blank text. So yeah, when It finds say http://www.consoleradar.com/forums/images/smilies/smile.gif I want it to change to images/smilies/smile.gif I could do it manually, It's just a lot of smilies to go through... so yeah, is there some SQL command I can use or something? Thanks Alan (DWZ) |
#2
|
||||
|
||||
Code:
UPDATE tblName SET clmName = REPLACE(clmName, 'findText', 'replaceText');
http://www.mysql.com/doc/S/t/String_functions.html |
#3
|
||||
|
||||
<n00b> I take it I should be replacing tblName and the two clmName bits of text to something else? - Im guessing tblName should be replaced to smilie but I can't work out what clmName is for... and I hate those MySQL docs, i can never work anything out... lol </n00b>
|
#4
|
||||
|
||||
OK, FireFly just helped me in the IRC channel...
For anyone who happens to be doing a search and want to know the answer, I used the MySQL command:[sql]UPDATE smilie SET smiliepath = REPLACE(smiliepath, 'http://www.consoleradar.com/forums/', '');[/sql]Thanks FireFly |
#5
|
||||
|
||||
No problems.
How do people know about the [sql] tag before it's even ready for use? :dead: |
#6
|
||||
|
||||
Quote:
|
#7
|
|||
|
|||
/me used it once or twice on some posts, people probably noticed it lol
/me's bad |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|