外链论坛

 找回密码
 立即注册
搜索
查看: 84|回复: 0

discuz批量替换/修改文章标题、帖子内容、关键词mysql执行代码

[复制链接]

244

主题

108

回帖

21万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
219605
发表于 2024-7-11 17:18:02 | 显示全部楼层 |阅读模式

我们做论坛网站时,如果网站中需要替换或修改多个文章,就需要使用SQL批量操作。以前我们讲过DZ论坛批量修改已发布贴子内容,今天再来讲一下,Discuz 如何批量修改门户文章标题及内容。

Discuz 批量替换/修改门户文章标题、内容?SQL命令:

批量替换门户文章标题:

UPDATE pre_portal_article_content SET content=REPLACE(subject,'替换前','替换后');

批量替换门户文章内容:

UPDATE pre_portal_article_content SET content=REPLACE(content,'替换前','替换后');

批量替换论坛贴子标题:

UPDATE pre_forum_thread SET subject=REPLACE(subject,'替换前,'替换后');

批量替换论坛贴子内容:

UPDATE pre_forum_post SET message=REPLACE(message,'替换前','替换后');

举例:

UPDATE pre_portal_article_content SET content=REPLACE(content,'

UPDATE pre_portal_article_content SET content=REPLACE(content,'height="500">','height="tt500">');

UPDATE pre_portal_article_content SET content=REPLACE(content,'','height="500">


UPDATE pre_portal_article_content SET content=REPLACE(content,'

UPDATE pre_portal_article_content SET content=REPLACE(content,'height="tt500">','height="500">');

提醒:在进行SQL批量操作前,不要忘记进行网站数据库备份。更多DISCUZ批量操作方法,请参考DISCUZ论坛常用批量修改SQL语句汇总。

注意:文章仅供参!



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

站点统计|Archiver|手机版|小黑屋|外链论坛 ( 非经营性网站 )|网站地图

GMT+8, 2024-10-3 22:27 , Processed in 0.060676 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.