This is a problem I've had for a while and not sure what is the best way to solve it. Its probably easier for me to explain using an example.
So I have many collections and many items. Some items can belong to one or more collections or none at all. Collections must have at least one item but there is no limit to the number of items that it can have.
How do I store this information in a MySQL database / what is the most efficient way of doing it?
I already have a table of items with a unique ID per item, thats the easy part, creating the collections part is where I'm stuck.
Do I create a new table for every collection, give it a unique table name and insert new records for each item that belongs in that collection?
Do I create just one large collection table with each record being a new collection and a single field of all the item ids?
Is there another way of doing it?
This will be queried using a php site if that makes any difference to the database structure.