This topic is locked

How to strip string?

1/14/2010 7:52:26 PM
PHPRunner General questions
F
frocco author

Hello,
In MySql, I need to strip this string (P205/50R16) to look like this (2055016) and store in the record.
How can I do this in MySql Query or PHP?
Thanks
Frank

F
frocco author 1/14/2010

I managed to do it like this:

But I need to create a custom import to refresh their data weekly.

So I guess PHP would be better.
update invmast set sizenum = Size

WHERE substring_index(Size,'/',1) = 'P175';
update invmast set sizenum = replace(sizenum, 'R','')

WHERE substring_index(Size,'/',1) = 'P175';
update invmast set sizenum = replace(sizenum, 'P','')

WHERE substring_index(Size,'/',1) = 'P175';
update invmast set sizenum = replace(sizenum, '/','')

WHERE substring_index(Size,'/',1) = 'P175';

J
Jane 1/15/2010

Frank,
use Before record added/Before record updated events on the Events tab to combine values and save it in the database.

All values are in the $values array.