[vB3/vB4] VERY general SQL query via AdminCP to change usernames in quotes.
by
25 Jun 2014
You gave someone a username change. Great, but his old username is still in all places where he was quoted in the past. Run this query in AdminCP, replacing with actual usernames HTML Code:
UPDATE post SET pagetext = REPLACE(pagetext, '=old name', '=new name') BUT: if there exists a apostrophe in the old username, the DB will think that's the end of the string and will kick a syntax error. Therefore where apostrophe exists in either username, double it, as such: '' Example: HTML Code:
UPDATE post SET pagetext = REPLACE(pagetext, '=Sammy''s', '=Elliot') You're welcome. |