We help IT Professionals succeed at work.
Get Started

MySQL question

lvollmer
lvollmer asked
on
1,059 Views
Last Modified: 2013-12-12
I have this query:


SELECT wp_users.user_login, wp_users.user_nicename, wp_users.display_name, wp_users.user_email, wp_usermeta.meta_value, wp_usermeta.meta_key
FROM wp_users LEFT JOIN wp_usermeta
ON wp_users.ID = wp_usermeta.user_id
WHERE RIGHT(wp_usermeta.meta_key,12) = "capabilities";

it will display a column called "meta_key" and it contains data like this: wp_31_capabilities, wp_15_capabilities etc

I have another table called "blog_homepage" that has two columns
blog_id
domain


blog id column has data like 31, 15

the "meta_key" column result of wp_31_capabilities is equal to the value of 31 in  the column blog_id in the table blog_home

I want to add an additional statement that matches those columns up, and displays the bloghomepage.domain column in the result set. Is this possible?


Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 61 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE