错误    SQL 查询:   
            INSERT  INTO db_news( title, cate, fromwhere, content, posttime, flags )
VALUES (
'cheshi5',  '0',  'cheshi5', '<p>        cheshi5cheshi5chescheshi5cheshi5cheshi5cheshi5</p>',  '1339494036',  'c,f,p'
)        MySQL 返回:
#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 '' at line 1

解决方案 »

  1.   

    mysql> show variables like '%charac%';    
    +--------------------------+----------------------------+
    | Variable_name            | Value                      |
    +--------------------------+----------------------------+
    | character_set_client     | utf8                       |
    | character_set_connection | utf8                       |
    | character_set_database   | utf8                       |
    | character_set_filesystem | binary                     |
    | character_set_results    | utf8                       |
    | character_set_server     | utf8                       |
    | character_set_system     | utf8                       |
    | character_sets_dir       | /usr/share/mysql/charsets/ |
    +--------------------------+----------------------------+
    8 rows in set (0.00 sec)看一下编码,我看到你的提示里有乱码问题。
      

  2.   

    本帖最后由 PhpNewnew 于 2012-06-12 19:17:09 编辑
      

  3.   

    问题解决
    数据库中的flags字段写成flag了
      

  4.   

    晕,那不是明显的SQLA语句有错误吗?