我在上传数据库时收到此错误#1054 - 未知列' 10'在'字段列表'

时间:2016-03-18 09:25:01

标签: mysql sql

错误 SQL查询:

INSERT INTO  `wp_jhn6gjgchw_comments` 
VALUES (

"1",  "111",  "xxxx",  "yyyyyy@gmail.com",  "http://www.aaa.com",  "10.10.10.10",  "2015-01-01 00:00:00",  "2015-01-01 00:00:00", "Hello admin please tell me how i can root my lg optimus p500 ,because without rooting i am not able to install kali linux ,please help me .",  "0",  "1", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",  "",  "0",  "0"
);

MySQL说:文档

  

1054 - 未知专栏' 10'在'字段列表'

2 个答案:

答案 0 :(得分:0)

您需要使用单引号''来提供值。

所以它应该像

insert into `yourtablename`
values('10','587',''.........)

另外,请确保为每列表格提供正确的值和所有值,因为您没有指定列名称。

在您的情况下,查询将类似于

INSERT INTO  `wp_jhn6gjgchw_comments` 
VALUES ('1',  '111',  'xxxx',  'yyyyyy@gmail.com',  'http://www.aaa.com',  '10.10.10.10',  '2015-01-01 00:00:00',  '2015-01-01 00:00:00', 'Hello admin please tell me how i can root my lg optimus p500 ,because without rooting i am not able to install kali linux ,please help me .',  '0',  '1', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36',  '',  '0',  '0');

答案 1 :(得分:0)

使用此格式

INSERT INTO `wp_jhn6gjgchw_comments`(`id`, `trans_id`, `refund_status`, `status`, `req_time`) VALUES ('10','g','dgfsf','gfh','hgh')