How to loop a query that is only able to handle 1 ROW at a time?

2012-08-19 Thread Incarus Derp
I have a two line query that is only able to handle 1 row per
execution. Could any of you give me some insight on how I could loop this
per every single row in the table? The query in question is:

SELECT PREG_REPLACE('/TeXT/', '' , Ivet) FROM `DB1`.`TB1` INTO @VAR12;
UPDATE `TB1` SET Ivet = @VAR12;


how to replace this data in a complex field?

2012-07-31 Thread Incarus Derp
I have a complex field named Inventory in a table named Table1 that can be
different every time and is not guaranteed to contain what I need to
replace.

[[Thing1,Thing4,thing8,thing1,thing942,ACRE_PRC119_ID_29],[[thing1700,2],datthing4,pizza,water,apples,beans,coke-a-cola,rice,apples,apples,icecream,pizza,[7things,6],7things,7things,8things,tophats,tophats,762x39mmRU]]

I need to replace ACRE_PRC119_ID_29 with ACRE_PRC119 and I cannot do this
externally. I have PREG_REPLACE but I'm not sure how I would apply this to
the database because it only SELECT's as far as I know.


  Any solutions?
-Ikarus