I have one table that stores a complete list of obstacles for a location, called spot_obstacles.
In this table I have location_id, obstacle_id, obstacle_size_id and obstacle_number.
I have another table that stores descriptions of the obstacles, called obstacles.
In this table I have obstacle_id and obstacle_description.
My other table stores details about the sizes of obstacles, called obstacle_size.
In this table I have obstacle_size_id and obstacle_size_description.
When a user views details about the an individual spot a query is run on the server that selects all the obstacles from spot_obstacles and then displays them to the user.
So far I have this sql
SELECT * FROM spot_obstacles
LEFT JOIN obstacles
ON spot_obstacles.obstacle_id = obstacles.obstacle_id
WHERE location_id = $spot_id
This gives me for example, 2 stair Handrail.
When what I would like it to say is Medium 7 stair Handrail.
The 1 in the first statement corresponds to small in my obstacle_size table.
But if I try to join the obstacle_size table on it prints out every option to the screen.
Hopefully I have made this clear enough for someone to be able to offer some advice.
See http://ttphp.open.ac.uk/~idl27/skatespots/spot_individual.php?spot_id=1
for an example of what I am doing.
Thanks very much.