警告:#1366整数值不正确:

时间:2015-02-17 06:46:02

标签: php mysql

我的桌子

product

的表结构
CREATE TABLE IF NOT EXISTS `product` (
  `id` int(11) NOT NULL auto_increment,
  `type` varchar(50) NOT NULL,
  `catid` int(11) NOT NULL,
  `subcat` int(11) NOT NULL,
  `price` varchar(500) NOT NULL,
  `sort_order` int(11) NOT NULL,
  `best_seller` int(11) NOT NULL,
  `new` int(11) NOT NULL,
  `active` int(11) NOT NULL,
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

转储表product

的数据
INSERT INTO `product` (`id`, `type`, `catid`, `subcat`, `price`, `sort_order`, `best_seller`, `new`, `active`, `timestamp`) VALUES
(1, 'Image', 0, 0, '275', 1, 0, 0, 0, '2015-02-17 11:59:29');

1 个答案:

答案 0 :(得分:0)

首先,在MySQL语法中,我猜您在create table语句中出错:int没有数量规范,(看here)表示:

CREATE TABLE dn170790rds.product (
id int NOT NULL AUTO_INCREMENT,
type varchar(50) NOT NULL,
catid int NOT NULL,
subcat int NOT NULL,
price varchar(500) NOT NULL,
sort_order int NOT NULL,
best_seller int NOT NULL,
new_ int NOT NULL, --new could be reserved word
active int NOT NULL,
timestamp timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

因此,在此更正后,您插入查询工作正常

相关问题