Jump to content

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


mfallon

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.