Jump to content

[SOLVED] JOIN, UNION, Not really sure. Please Help!


Recommended Posts

OK so hears the situation.

 

I have created my table with id's and values to try and simplify the DB structure but now can't work out how I run a query to get it display what I want. Here is an example.

 

Table 1 - Users

id

username

fav_colour_id

1

Matt

2

 

Table 2 - Colours

id

colour

1

blue

2

red

3

white

 

I want to be able to perform a query which returns the username and the favourite colour but I'm not sure how to do this.

 

I have spent the last few hours looking at joins and various other functions but I just can't get my head around what I need to be using.

 

Once I can get the data outputted I can work out how to format it in my PHP website and get it to display there, I just need to work out how I get it to query at all.

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.