I want to have a picture gallery and each gallery will be marked with a set of tags, I want users to be able to search for any number of these tags and I'd like if it were somewhat efficient. I don't really know where to begin.
Each category has an entry in the 'categories' table, something like this:
id | name | description
---+------+------------------------------------
0 | cats | This is a gallery full of cats
1 | dogs | This is a gallery full of dogs
and each entry in the 'galleries' table would have multiple category IDs stored for each category they belong in (though I'm not sure how I'd store them or query them at this time)
If it weren't for the search function I planned on I'd just serialize the category array, but that's not efficient to query at all.