我的桌子
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');
答案 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 ;
因此,在此更正后,您插入查询工作正常