在做历史数据迁移的时候发现了数据库会自动转译的问题
页面显示原数据:
数据库中:
代码中:
1\n2\n3\n4
将老数据读取后重新拼装入库 数据库会多加一个\,页面就变成了
最后执行下sql替换
update table set test= replace(test, ‘\n’, ‘\n’) where id >0;
在做历史数据迁移的时候发现了数据库会自动转译的问题
页面显示原数据:
数据库中:
代码中:
1\n2\n3\n4
将老数据读取后重新拼装入库 数据库会多加一个\,页面就变成了
最后执行下sql替换
update table set test= replace(test, ‘\n’, ‘\n’) where id >0;