I am running this query
select * from user_meta JOIN user ON user_meta.userid=user.userid where user_meta.userid=9
But this is not resulting what i wanted, its returning multiple lines.
My one table looks like this name user_meta
:
umeta_id userid meta_key meta_value
1 9 mobile 123324
2 9 address some address
3 9 city some city
4 9 country some country
5 9 occupation some details
6 9 website someurl
7 9 mobile 123324
8 9 address some address
9 9 city some city
10 10 country some country
11 10 occupation some details
12 10 website someurl
Another table looks like this name user
:
userid username fullname email role
9 someuser john Doe 123324@gmail.com admin
How can i make it select the query so that all the values related to userid 9
can be fetch from both the tables and make it look like this
Desired output:
userid username fullname email role Mobile address city country occupation website
9 someuser john Doe 123324@gmail.com admin 123123 someaddres Somecity somecountry some details someurl
Thank you! (In Advance!)