Im trying to do something like this (This is MySQL format)
SELECT q.question_id, q.question, q.answer
FROM relationship r, questions q
WHERE r.cat_id =1
AND r.question_id = q.question_id
LIMIT 0 , 30
So, I got questions stored in one table, then categories in another table. I have the relationship table set up so that a question can be in multiple categories. So say a question has an id of 5, and its in 3 different categories, the relationship table would look like this
relation_id, question_id, category_id
1 5 1
2 5 2
3 5 3
4 6 1
So, say I wanna get all the questions with the cat_id of 1, I should get 2 results. That's basically what I'm trying to do.