今天做destoon开发时候在后台添加自定义字段时候出现:destoon7.0-8.0添加自定义字段报错
MySQL Query:INSERT INTO [pre]fields (tb,name,title,note,type,length,html,default_value,option_value,width,height,input_limit,addition,search,display,front) VALUES ('article_21','demo','关键词','','varchar','255','text','','','120','90','','size=\"30\"','0','1','1') MySQL Error:Unknown column 'search' in 'field list' MySQL Errno:0 Message:MySQL Query Error
原因:为什么会出现这个问题?原来是 fields表中少了一个search字段,只需要在表中设计添加search字段即可,如:
保存即可,或者用以下的代码:
CREATE TABLE `你的表名改下_fields` ( `itemid` int(10) unsigned NOT NULL AUTO_INCREMENT, `tb` varchar(30) NOT NULL DEFAULT '', `name` varchar(50) NOT NULL DEFAULT '', `title` varchar(100) NOT NULL DEFAULT '', `note` varchar(255) NOT NULL DEFAULT '', `type` varchar(20) NOT NULL DEFAULT '', `length` smallint(4) unsigned NOT NULL DEFAULT '0', `html` varchar(30) NOT NULL DEFAULT '', `default_value` text NOT NULL, `option_value` text NOT NULL, `width` smallint(4) unsigned NOT NULL DEFAULT '0', `height` smallint(4) unsigned NOT NULL DEFAULT '0', `input_limit` varchar(255) NOT NULL DEFAULT '', `addition` varchar(255) NOT NULL DEFAULT '', `search` varchar(255) DEFAULT NULL, `display` tinyint(1) unsigned NOT NULL DEFAULT '0', `front` tinyint(1) unsigned NOT NULL DEFAULT '0', `listorder` smallint(4) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`itemid`), KEY `tablename` (`tb`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='自定义字段';
文章转自:destoon7.0-8.0添加自定义字段报错INSERT INTO [pre]fields_destoon-考高分网 (kaotop.com)