mysql - Incrementing numerical value and changing string in SQL -
i have database has stored values in complicated, serialized array 1 component string , length of characters of string, in format:
s:8:"test.com"
where "s" holds character length of string in quotations.
i change string "test.com" "testt.com", , i'm using following statement in sql:
update table set row=(replace (row, 'test.com','testt.com'))
however, breaks script in question, because doesn't update character length in "s" preceding string "test.com" stored.
i wondering if there query can use replace string, , increment value of "s" preceding replacement occurs, this:
update table set row=(replace (row, 's:' number 'test.com','s:' number+1 'testt.com'))
does know if kind of query possible?
update table set row = concat('s:',length('testt.com'),':"testt.com"');
Comments
Post a Comment