我查了一下,原来是 word 编码问题,虽然是从网上html 中拷过来的内容,但是原内容却是来自word,请问应如何处理好呢?从前用 mysql 4.x 没有这个问题<P>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="FONT-SIZE: 16pt; FONT-FAMILY: 仿宋_GB2312; mso-hansi-font-family: 宋体; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">

解决方案 »

  1.   

    SQL语句呢?word编码问题是什么? 要不你先试试把要从网页上拷出来的内容贴到记事本,然后在从记事本复制到执行SQL的地方.(记事本是无格式的,能过滤HTML代码.如果你是直接从HTML源码中复制的,手动把HTML标签去掉吧)
      

  2.   

    数据库错误在xiehui:无效的SQL语句: insert into news(title,content,date,code,code1,area_code,jindu_code,project_code,from1,info_kind,op_loginname,op_realname,fback,frm_name,href,pic,fbu_unit,jishu_code,shebei_code,tz_money) values('<P>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="FONT-SIZE: 16pt; FONT-FAMILY: 仿宋_GB2312; mso-hansi-font-family: 宋体; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
    关于举办全国现代设备投资与管理研讨会的通知',' 
    中设[2006]63号
    ','2006-10-13',1039,0,0,0,0,'http://www.',1,'xiehui','xiehui',1,'','http://www.cape.org.cn/com.hd.DoServlet?func=SY_HOME_EA&act=showEA&pdefCode=032101&@infoCode@=11173493','','',0,0,'')
    MySQL错误: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 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast' at line 1
    MySQL错误号码:1064
      

  3.   

    引号转义,看你的这句里头几个单引号?
    '<P>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="FONT-SIZE: 16pt; FONT-FAMILY: 仿宋_GB2312; mso-hansi-font-family: 宋体; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
    关于举办全国现代设备投资与管理研讨会的通知','
    中设[2006]63号
    '