I have three tables called 'pages', 'keyword' and 'kw_t_p'.
The 'pages' table have the following fields:
p_id, p_title
The data are stored in this form:
1, Title 1
2, Title 2
The 'keyword' table have the following fields:
kw_id
kw_label
The data are stored in this form:
1, Car
2, Dog
3, Food
and so on...
The 'kw_t_p' table have the following fields:
kw_nr
p_nr
The data are stored in this form:
3, 1
2, 2
2, 1
6, 1
1, 1
5, 1
10, 2
8, 2
1, 2
7, 2
All items have 5 keywords connected to them. As you can see the first item have the following keywords 3, 2, 6, 1, 5, item two have 2, 10, 8, 1, 7
I need to run a query that returns all keywords (Car, Dog and so on) for a certain item (1, 2 and so on).
I know how to search for all kw_nr with a certain p_nr but that does not give me the keywords, just numbers that the keyword represents.
How do I build a query that can handle this?