Somebody uploaded some bad data (serialized php) into my database and I'm trying to figure out how to clean it up using a MySQL query.
The bad data looks like this:
I've tried this pair of queries but my database keeps giving me the all too familiar, "You have an error in your SQL syntax;"
value, '"', -2) WHERE fid = 1 AND uid = 22;
value TRIM(TRAILING '";}' FROM
value) WHERE fid = 1 AND uid = 22;
I built these queries using these examples from the MySQL reference:
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2);
mysql> SELECT TRIM(TRAILING 'xyz' FROM 'barxxyz');
Any direction anyone can give would be greatly appreciated.