Cognatus wrote:I need to search for "Interface\\Icons" in the Roster database in the wowroster_items table, row item_texture, and replace with nothing or "/images/icons/". Can anyone let me know the best way to go about this? At the moment my page doesn't display any icons because the above text is in the image url path, and they are located elsewhere.
Posted by Alex de Landgraaf on July 22 2004 12:07am
You sometimes run into the problem that you want to replace a substring occuring in a column with a different string, without touching the rest of the string. The solution is surprisingly simple, thanks to MySQL:
UPDATE xoops_bb_posts_text
SET post_text=(
REPLACE (post_text,
'morphix.sourceforge.net',
'www.morphix.org'));
using the string function REPLACE, all items in the post_text column with 'morphix.sourceforge.net' get this substring replaced by 'www.morphix.org'. Ideal when writing a script is just too much effort.
update wowroster_items SET item_texture=(REPLACE (item_texture,'Interface\\Icons\\','/images/icons/'));
update wowroster_items SET item_texture=(REPLACE(item_texture,'Interface\Icons\','/images/icons/'));
$item['icon'] = substr_replace($item['item_texture'], '', 0, 18);
Users browsing this forum: No registered users and 0 guests