一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

wordpress中修改文章ID sql语句

时间:2022-06-25 18:56:58 编辑:袖梨 来源:一聚教程网

UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值


将ID为3368的文章修改为189

 代码如下 复制代码

update wp_posts set id = 3368 where id = 189;
update wp_term_relationships set object_id = 3368 where object_id = 189;
update wp_postmeta set post_id = 3368 where post_id = 189;
update wp_comments set comment_post_ID = 3368 where comment_post_ID = 189;

将ID为189的文章修改为3368

 代码如下 复制代码

UPDATE `wp_posts` SET `ID` = '189',`guid` = www.111com.net 189' WHERE `wp_posts`.`ID` =3368;
UPDATE `wp_term_relationships` SET `object_id` = '189' WHERE `wp_term_relationships`.`object_id` =3368;
UPDATE `wp_postmeta` SET `post_id` = '189' WHERE `wp_postmeta`.`post_id` =3368;
UPDATE `wp_postmeta` SET `post_id` = '189' WHERE `wp_postmeta`.`post_id` = 3368;
UPDATE `wp_comments` SET `comment_post_ID` = '189' WHERE `wp_comments`.`comment_post_ID` = 3368;

两种方法都行,上面是Pop在网上搜集,下面的是Pop手动修改MySQL得到的代码。

热门栏目