MySQL query to search for items with certain tags
问题 I have a MySQL database with the following tables: items | id, item items_tags | id, item_name, item_id, tag_name, tag_id tags | id, tag I'd like to allow the user to search for items with any tag or any combination of tags. Here's some example data to show what I'd like to do: items: id | item ----------- 1 | banana 2 | orange 3 | tomato items_tags: id | item_name | item_id | tag_name | tag_id --------------------------------------------- 1 | banana | 1 | yellow | 1 2 | banana | 1 | fruit |