First of all i don’t know whether the title is relevant or not (please forgive me if it’s not relavant).
I have 2 tables userprofile and country.
userprofile table:-
-----------------------------------------
userid | email |............|**countryid**
-----------------------------------------
country table:-
-----------------------------------------
**countryid** | countryname
-----------------------------------------
I want to select data from the userpfofile table,
i.e $query="select * from userprofile …but the problem is that this data returns countryid but I actually want to return countryname.
I am new to MySQL, so please suggest the best way to achieve this.
You need to join these two tables together to get the data you want, like so:
This will produce a result set similar to: