本帖最后由 mccad 于 2010-11-3 14:39 编辑
真是头大,自己改了一下,改成这样:- $subject = str_replace("\\'","'",$dvt['title']);
- $subject = cutstr(htmlspecialchars(trim(@strip_tags($subject))), 78);
- $subject = str_replace("'","\\'",$subject);
复制代码 但又出现下面的错误,另外一个位置的反斜杠号又出问题了,原标题是:
请问如何将字符串 "\"图层10\"" 变为 "图层"
- XConvert info: MySQL Query Error
- Time: 2010-11-3 6:35am
- SQL: INSERT INTO discuz_temp.pre_forum_thread (tid, fid, posttableid, typeid, sortid, readperm, price, author, authorid, subject, dateline, lastpost, lastposter, views, replies, displayorder, highlight, digest, rate, special, attachment, moderated, closed, stickreply, recommends, recommend_add, recommend_sub, heats, status, isgroup) VALUES ( '43738', '3', '0', '0', '', '0', '0', 'tc405003', '102301', '请问如何将字符串 \"\\\"图层10\\\"\" 变为 \"图层\', '1130777280', '1130824020', 'tc405003', '640', '7', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');
- Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1130777280', '1130824020', 'tc405003', '640', '7', '0', '0', '0', '0', '0', '0',' at line 1
- Errormsg.: 可能原因:1.数据超长或类型不匹配;2.数据库记录重复
- Errno.: 1064
复制代码 |