I have quite a few people that post images with links that point to usercash - is there a query or update that can replace everything in a tag that contains usercash.com in ...e numbers change in every post. Thanks.
Unfortunately, there's no SQL query that can do this for you. mySQL doesn't support any kind of wildcard or regular expression searching and replacing within queries. You would ba able to do this by using a script (php, perl, python, whatever) that selected each row containing "usercash.com", and then used that languages built in pattern matching to replace the string--even the unique number in front--to google, or just remove it altogether.
How many links is quite a few? lol Export the DB to your computer, open with Textpad (http://www.textpad.com), and you can do a find and replace with wildcards (*.usercash.com). Once done, reimport the DB with BigDump, or phpMyAdmin. NOTE: Make a backup before doing anything with your DB!!
Are you sure? Reference #1: http://dev.mysql.com/doc/refman/5.1/en/select.html Reference #2: http://dev.mysql.com/doc/refman/5.0/en/pattern-matching.html
It allows it in matching and searching, but the replace function does not support it in MySQL. You either have to write a complex SQL statement to extract the exact term you want to replace or you can do it with a PHP/ASP/etc... script.
Yeah, I wish I was wrong though. It would be a very useful feature. I said mySQL doesnt support search and replace with regular expressions. It can search posts just fine (which is what those links show), but can't do replacements based on those expressions.
Again, I am not sure I understand the problem, but wouldn't the following statement be somewhat of a solution? UPDATE new_users SET new_users.user_state = 'active' WHERE new_users.user_name REGEXP '[1234567890~!@#$%^&*()_+|}{":?><,./;]' Code (markup):