So, I would like to get rid of the user profile field for the emoticon set, but I also need to make a few database changes.
So first of all:
I have a lot of posts with contents like this (in the posts table's post column):
CODE
<!--emo&:achysan:--><img
src='emoteURL/achysan.gif' alt='achysan.gif' /><!--endemo-->
src='emoteURL/achysan.gif' alt='achysan.gif' /><!--endemo-->
Which should now look like this:
CODE
<img
src="style_emoticons/<#EMO_DIR#>/achysan.gif" style="vertical-align:middle"
emoid=":achysan:" border="0" alt="achysan.gif" />
src="style_emoticons/<#EMO_DIR#>/achysan.gif" style="vertical-align:middle"
emoid=":achysan:" border="0" alt="achysan.gif" />
A select query will return results:
CODE
SELECT * from ibfmain_posts WHERE post LIKE "%<!--emo&:achysan:--><img src='emoteURL/achysan.gif' alt='achysan.gif' /><!--endemo-->%" LIMIT 25;
will give me 25.
But an update query like this:
CODE
UPDATE ibfmain_posts SET post = replace(post, "%<!--emo&:achysan:--><img
src='emoteURL/achysan.gif' alt='achysan.gif' /><!--endemo-->%", '<img
src="style_emoticons/<#EMO_DIR#>/achysan.gif" style="vertical-align:middle"
emoid=":achysan:" border="0" alt="achysan.gif" />');
src='emoteURL/achysan.gif' alt='achysan.gif' /><!--endemo-->%", '<img
src="style_emoticons/<#EMO_DIR#>/achysan.gif" style="vertical-align:middle"
emoid=":achysan:" border="0" alt="achysan.gif" />');
will just give me "Query OK, 0 rows affected", leading me to believe that it failed to retrieve any matching rows and thus didn't even try to do any replacements. I'm assuming I need to escape some of the first argument's value, but how/what?
Any help greatly appreciated.
