自己的一个dedecms网站在升级5.7后,发现后台广告管理有错误,提示:
---------------------------------------------------------------------------------
Error page: /dede/ad_main.php
Error infos: Unknown column ‘ad.clsid’ in ‘on clause’
Error sql: SELECT COUNT(*) AS dd FROM `dede_myad` ad LEFT JOIN `dede_arctype` tp on tp.id=ad.typeid LEFT JOIN `dede_myadtype` ap on ap.id=ad.clsid WHERE 1=1 LIMIT 0,1;
DedeCMS Error Warning!
Technical Support:
Error page: /dede/ad_main.php
Error infos: Unknown column ‘ad.clsid’ in ‘field list’
Error sql: SELECT ad.aid,ad.clsid,ad.tagname,tp.typename as typename,ad.adname,ad.timeset,ad.endtime,ap.typename as clsname FROM `dede_myad` ad LEFT JOIN `dede_arctype` tp on tp.id=ad.typeid LEFT JOIN `dede_myadtype` ap on ap.id=ad.clsid WHERE 1=1 ORDER BY ad.aid desc LIMIT 0,20
---------------------------------------------------------------------------------
官方的解释说这是因为数据库myad缺少了clsid字段。
解决方法:
1.直接去进入PhpMyAdmin中修改数据表,或
2.进入『网站后台』-『系统』-『SQL命令行工具 』执行sql命令
ALTER TABLE `dede_myad` ADD COLUMN `clsid` int(10) NOT NULL DEFAULT 0 AFTER `aid`;