I'm quite inexperienced in mysql so this one has me stumped. The mission, should you care to accept it, is as follows:
A database of, oh lets be classical and say, Widgets.
Table : widgets.
Columns: widget_id,widget_name
Sample data:
1,SnazzyWidget
2,SleepyWidget
Table: widget_attributes
Columns: attribute_id, attribute_name
Sample data:
1, Can fly
2, Can talk
3, Multi-coloured
4, Executive class
Table: attribute_map
Columns: widget_id, attribute_jd
Sample data:
1,1
1,4
1,3
2,3
I hope you get the picture. attribute_map maps the two other tables together. A widget can have more than one attribute, as in the sample SnazzyWidget can fly, is multi-coloured and is Executive class.
So in the widget product page I want to print a list of all the attributes the particular widget has according to the database.
Now how on Earth do I code this??? Is this even the right structure to use here? Any help with the queries would be appreciated!