WordPress.org

Support

Support » How-To and Troubleshooting » User_login from wp_users to wp_usermeta

User_login from wp_users to wp_usermeta

  • oskarkxyz
    Member

    @oskarkxyz

    Hello.

    I need to do a script for my wordpress and I really need a wp_login in wp_usermeta. In wp_usermeta I can see only their ID and in wp_users I can see their ID and login.

    Is there a way to copy one column and add it into other table? Would be awesome if it would also updates automaticaly (when the orginal column updates also the copy does).

    Regreds,
    Oskar.

Viewing 1 replies (of 1 total)
  • Christian1012
    Member

    @christian1012

    I don’t think that’s really what you want to do. They are in different tables for a reason, why would you want to duplicate tables in the same database?

    Can’t you just include it in your query? Example:

    SELECT wp_usermeta . * , wp_users.user_login
    FROM wp_usermeta
    INNER JOIN wp_users ON wp_usermeta.user_id = wp_users.ID
    WHERE wp_usermeta.user_id = 1;

Viewing 1 replies (of 1 total)
  • The topic ‘User_login from wp_users to wp_usermeta’ is closed to new replies.