Regex is not available for replace but what about multiple replace behave as regex
UPDATE `usertree` SET branchIndex=REPLACE(branchIndex,'80',''),
branchIndex=REPLACE(branchIndex,',,',',') WHERE id=1
its working successfully, do it have drawbacks ? I get into trouble later
My new tree game has good number of technologies attached to it:
I am saving added branches in a column name branchIndex and it is a comma seprated string holding branch positions on tree.
But when user cuts a branch I need to remove that index from string, plus keep the string accurate. Also it would be happening more frequently by more then 2000 – 3000 users.
These steps can be done in one run, breaking for more clear view:
Better keep it like this: