Slashcode Log In
search and replace in mysql tables
n8 writes "I was changing the URL and siteid of a slash site, and I wanted to change every occurence of the old domain name in the vars table. I figured out that you can do this in mySQL using the replace() string function:
UPDATE vars SET value = replace(value, 'newvalue', 'oldvalue') WHERE value REGEXP 'oldvalue';
You could do something similar with the templates table too (though the template-tool has a substitution feature also). But be careful with this sort of thing! You could omit the WHERE clause too."
This discussion has been archived.
No new comments can be posted.
The Fine Print:
The following comments are owned by whoever posted them. We are not responsible for them in any way.


