Allow users to create their own categories and add items to it
-
27-10-2019 - |
Question
I want to allow any user to create a category using a text field. I want to let them create any number of categories they want, with any name they want. The problem is I have no idea how to set up the tables to accomplish this. I know the PHP to check to see if it exists for the user and update or add it, how do I store it?
Here's how I thought about doing it.
Table: Categories Columns: category, id, userid
User adds a new category Create a new record that has a category, id, and userid.
User deletes a category Find the related row and remove it
What I'm concerned about is having a large number of users creating a large number of categories and the table having an excessive number of rows. Is that a valid concern? Will it cause performance issues if the number of rows gets into the millions?
Any suggestions appreciated.
Solution
What this boils down to is a one too many relationship, at the time I posted this I just didn't understand what that meant.