首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

#1064 - You have an error in your SQL syntax; check the manual that correspond

2012-08-14 
求助#1064 - You have an error in your SQL syntax check the manual that correspond执行sql语句返回:#

求助#1064 - You have an error in your SQL syntax; check the manual that correspond
执行sql语句返回:
#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

数据库表:

 字段 类型 整理 属性 Null 默认 额外 操作 
  rid mediumint(7) 否 auto_increment  
  id mediumint(7) 否 0  
  fid mediumint(7) 否 0  
  uid mediumint(7) 否 0  
  content mediumtext gbk_chinese_ci 否  
  my_bus varchar(50) gbk_chinese_ci 否  
  my_station varchar(100) gbk_chinese_ci 否  
  my_rooms varchar(30) gbk_chinese_ci 否  
  my_price int(8) 否 0  
  my_peitao varchar(150) gbk_chinese_ci 否  
  my_acreage varchar(12) gbk_chinese_ci 否  
  my_fitment varchar(15) gbk_chinese_ci 否  
  my_floor varchar(12) gbk_chinese_ci 否  
  sortid tinyint(1) 否 0 


sql语句:INSERT INTO 表名(id,fid,uid,content,my_rooms,my_price,my_peitao,my_acreage,my_fitment,my_floor,sortid);
 VALUES('41','11','1','content','1室1卫','1300','水/电/电话','44.0','普通装修','9','1');

我错在哪里?

[解决办法]
id mediumint(7) 否 0 

数字字段,你为什么要加引号? 

把数字字段对应的值的引号先去掉试一下。
[解决办法]
先换成非汉字看看是否能插入成功


或者试试


set names gbk;
insert ....
[解决办法]
INSERT INTO 表名(id,fid,uid,content,my_rooms,my_price,my_peitao,my_acreage,my_fitment,my_floor,sortid); #这里有个分号?
 VALUES('41','11','1','content','1室1卫','1300','水/电/电话','44.0','普通装修','9','1');
[解决办法]
set names 'gbk';

热点排行