需要被替换的关键字为
<h4 class=\"subt\">我用
update 'news' set newstext=replace(newstext,'<h4 class=\"subt\">','')出错:
#1064 - 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 ''phome_ecms_news' set newstext=replace(newstext,'<h4 class=\"subt\">','')' at line 1 

解决方案 »

  1.   

    update 'news' set newstext=replace(newstext,' <h4 class=\"subt\">','')和你的报错信息并不一至, syntax to use near ''phome_ecms_news' set newstext=replace(newstext,' <h4 class=\"subt\">','')' at line 1 想办法先找到出错的语句。另外注意不要用单引号把表名括起来,直接 update news set ..
      

  2.   

    mysql 关键字用引号引起来
      

  3.   

    mysql 关键字用引号引起来
      

  4.   

    提示出错的地方不是贴出来的这一部分SQL语句,lz把SQL语句全贴出来吧。
      

  5.   

    mysql> select * from news;
    +----------------------+
    | newstext             |
    +----------------------+
    | <h4 class="subt"ring |
    +----------------------+
    1 row in set (0.01 sec)
    mysql>  update news set newstext=replace(newstext,"<h4 class=\"subt\"",'');
    Query OK, 1 row affected (0.03 sec)
    Rows matched: 1  Changed: 1  Warnings: 0mysql> select * from news;
    +----------+
    | newstext |
    +----------+
    | ring     |
    +----------+
    1 row in set (0.00 sec)
      

  6.   

    所出错表 'phome_ecms_news' 
    你所改表 news