MySQL Forums
Forum List  »  General

Query problem...
Posted by: videodead
Date: January 22, 2005 04:56AM

I have the following table...

+----+-------------+----------+
| id | category_id | item_id |
+----+-------------+----------+
| 3 | 1 | 1 |
| 4 | 4 | 1 |
| 5 | 6 | 1 |
| 6 | 4 | 2 |
| 7 | 1 | 3 |
| 8 | 4 | 3 |
| 9 | 6 | 3 |
| 10 | 3 | 4 |
| 11 | 12 | 4 |
| 12 | 14 | 4 |
| 13 | 1 | 5 |
| 14 | 1 | 6 |
| 15 | 1 | 7 |
| 16 | 5 | 8 |
| 17 | 13 | 8 |
+----+-------------+----------+

I have a search that allows users to pick the categories they want to view items from but also to choose to not show items with other categories, is there any way in my query to stop an item from showing if it has both categories chosen, in other words, if the user wanted to view all the items from category 1 but not category 4 could i make items 1 and 3 not show up in the results?


~jamie

Options: ReplyQuote


Subject
Written By
Posted
Query problem...
January 22, 2005 04:56AM
January 22, 2005 11:53AM
January 22, 2005 03:50PM
February 13, 2005 06:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.