mysql数据库插入数据失败

qubaaita 2012-06-12 05:55:45
错误 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
...全文
158 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
天魔雷帝 2012-06-12
  • 打赏
  • 举报
回复
晕,那不是明显的SQLA语句有错误吗?
qubaaita 2012-06-12
  • 打赏
  • 举报
回复
问题解决
数据库中的flags字段写成flag了
黄袍披身 2012-06-12
  • 打赏
  • 举报
回复
<p> 我猜是这里...编码
qq120848369 2012-06-12
  • 打赏
  • 举报
回复
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)


看一下编码,我看到你的提示里有乱码问题。
qubaaita 2012-06-12
  • 打赏
  • 举报
回复
就是在mysql里执行的
qq120848369 2012-06-12
  • 打赏
  • 举报
回复
在mysql里执行试试?

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧