I have one database with 6 tables.
One of the table is named category and it has 5 or 6 categories in it.
For example: Movie category that has the comedy, drama, thriller, horror, romance sub categories etc.
So can I, in the table, add the sub categories, or should I create them like tables?
And if I have a lot of data to add in the database is there any easier way to do it?
I’m working with xampp.
Add a
categoryOffield to thecategorytabel, it will be used to store the id of the ‘parent category’.For a sub category use this field to point to the category of which it is a sub category of.
Leave the field empty for (main) category entries
For example:
Note: Using this method, you can even add sub-sub-categories if you like…