SQL语句更新原有文章的栏目可以用批量区间性这样更方便些,如果只是几个移动手工最快:
首先解析一下表,把栏目A下的文章移动到栏目B下,以下4张表里的内容会更改(示例):
phome_ecms_news(主表)
phome_ecms_news_data_x(这个具体要看文章在哪个副表里,一般x是数据1)
phome_ecms_news_index(索引表)
phome_enewsfile_1(信息附件分表1)
上面是新闻数据表的4张表
比如把栏目ID为888的文章移动到栏目ID为999下,SQL语句如下:
UPDATE phome_ecms_news SET `classid` = '888' WHERE `phome_ecms_news`.`classid` = 999;
UPDATE phome_ecms_news_data_1 SET `classid` = '888' WHERE `phome_ecms_news_data_1`.`classid` = 999;
UPDATE phome_ecms_news_index SET `classid` = '888' WHERE `phome_ecms_news_index`.`classid` = 999;
UPDATE phome_enewsfile_1 SET `classid` = '888' WHERE `phome_enewsfile_1`.`classid` = 999;
当然,文章移动了目录也会跟着变如果有收录,记得做301重定向。
本文摘自网络,不代表短经典网立场 https://www.duanjingdian.com/453.html