1, application scenarios: mysql in a data field contains a line break, leading to an error when parsing json front desk
“Uncaught SyntaxError: Unexpected token in JSON at position 333”;
2, ++ for the above view data may be pasted into the Notepad, wherein part of the problem as follows json
"info":"mysql1,\r\nmysql2"
3, to address the problem field inquiries, the following statement in mysql database
select * from test where info like CONCAT('%',char(10),'%');
You can check the test data sheet info field contains a line break what;
4, line breaks will be included in the removal, you can execute the following statement
update test
set info = replace(replace(info,char(10),''),char(13),'')
where info like concat('%',char(10),'%');
5, in addition to the newline \ r \ n for, for \ t tab tab stops, the following statement may be employed
select * from test where info like CONCAT('%\t%');
update test
set info = replace(info,'\t','')
where info like concat('%',char(10),'%');