skip to Main Content

I am selecting a value from wordpress database but I am having an error, I saw on many websites before and on this forum but nothing helped.

SELECT `meta_value` 
FROM `wp_usermeta` 
WHERE `meta_key`=`wp_capabilities`
AND `user_id` = 1;

Unknown column ‘wp_capabilities’ in ‘where clause’

2

Answers


  1. instead of wp_capabilities (`) you need to use ‘wp_capabilities’ (‘). Please try this:

    SELECT `meta_value` 
    FROM `wp_usermeta` 
    WHERE `meta_key`='wp_capabilities'
    AND `user_id` = 1;
    
    Login or Signup to reply.
  2. the column you want is configured with the roles and capabilities of wordpress. if you don’t have it, maybe something was configured wrong when you installed wordpress. here you can read more about it.

    https://wordpress.org/support/article/roles-and-capabilities/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search