SQL查询以批量更改数据库中Wordpress中的角色? [英] Sql query to bulk change roles in Wordpress in the database?

查看:53
本文介绍了SQL查询以批量更改数据库中Wordpress中的角色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Wordpress:我需要使用用户ID"在数据库中批量更改用户角色.像这样:

Wordpress: I need to bulk change user roles in the database using the "user id". Something like:

查找ID为2827、772、234、983、14999的用户,并将其角色设置为"custumer"

我知道角色已保存在表"wp_usermeta"中的"meta_key = wp_capabilities"和"meta_value = a:1:{s:6:"editor"; b:1;}"字段中.

I know that the roles are saved in the table "wp_usermeta" in the fields "meta_key=wp_capabilities" and "meta_value=a:1:{s:6:"editor";b:1;}".

但是我不知道如何创建slq查询来搜索和替换它们以更改其值.请参见所附的捕获内容.

But I don't know how to create the slq query to search and replace them to change their values.See capture attached.

推荐答案

对我来说,最简单的方法是使用phpmyadmin并编辑一条记录.该响应将为您提供正确的sql语句.然后为其他ID运行

Easiest for me is to use phpmyadmin and edit one record. The response will give you the proper sql statement. Then run that for the other ids

这篇关于SQL查询以批量更改数据库中Wordpress中的角色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆