Hello everyone,
I need help in querying an image library, in which I set up two tables: one that contains info about the image (called images) and one that associates each image with a keyword, called keywords (this is a one-to-many relationship - an image can have up to 7 keywords). The keywords table has these fields kID (primary #), ImageID (the same from the images table), and Keyword. So it looks like:

kID GraphicID Keyword
1 1 woman
2 1 white
3 1 frown
4 2 man
5 2 black
6 2 smile

What is the best way to query the images and keywords table so that it narrows down users' search? For instance, if users type in a form two search words (search_k1 and search_k2), I would want only those records that equal BOTH these keywords to show up (instead of records that equal search_k1 AND records that equal search_k2 -- which is what I am getting now).
Thanks,

Reply