Jump to content

Grab data from 2 tables.


sean04

Recommended Posts

Hey guys, so I have 2 tables...

 

user_detail

ID      Email                                          Country

1      Sean.Middaugh@gmail.com        1

 

country

ID    Country

1    Canada

2    States

 

How can I write a query so when I call a variable to get my country it gets "Canada" instead of "1"

 

Thanks!

Link to comment
Share on other sites

Thanks for the reply!

 

I get this error: Resource id #10

 

I want to call the results from another page... Like a profile page of that user.

 

$loggedUserCountry = mysql_query("SELECT u.User_ID, c.Country_Description FROM user_detail u JOIN country c ON u.Country = c.ID WHERE User_ID = 'logged[user_ID]'");

 

Then on the profile page I do this Country: $loggedUserCountry

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.