I'm not sure if a "sub-table" is the proper term for it, so let me explain a bit better.
I'm setting up a website which contains multiple items, now I've created 2 separate tables in my MySQL database: general
and platforms
.
My goal now is to split the data of each item into these 2 tables, which works fine so far, but my problem now is the following:
The platforms
table has the following structure:
ID
Name
URL
I want to keep track of each item by their ID
, so the ID
for item #1
should be equal in all tables.
Now, if I have say 3 different platforms for item #1
, I'll add every element in the platforms
table, but their ID
's don't match.
And if I have multiple items, each with multiple platforms it will start to look really messy.
Is it possible to have a table that looks like this?
ID
Name
URL
Hopefully the images clarify it more, basically; I want to have a table that groups together multiple elements.
Is this possible or would I have to do it by assigning a secondary non auto-incrementing ID to each item and manually group the platforms together in PHP?