MySQL Array Solution?
Posted: Thu Mar 25, 2010 11:56 pm
I am currently working on a project with PHP and MySQL. Some of the requirements are that I have a user/login system, a messaging system, a calendar, and projects that the users are part of and that show up on the calendar. I am trying to find a solution to store the information for the projects and the people involved with them.
I have a table for users and am planning on a table for projects. I initially thought about just having a column in the projects table that would be of type array. The array would hole users associated with the project in that row. I realized however that arrays aren't a column type. I've tried thinking of many different ways to solve this, but I always run in to the same problem. I have no way of knowing how many different users will be part of any project or how many different projects any one user will be a part of.
I don't know if there's a way to accomplish what I want through complicated logic or if there's some way to do it using MySQL. I'm sure that there is some way to do this though.
I have a table for users and am planning on a table for projects. I initially thought about just having a column in the projects table that would be of type array. The array would hole users associated with the project in that row. I realized however that arrays aren't a column type. I've tried thinking of many different ways to solve this, but I always run in to the same problem. I have no way of knowing how many different users will be part of any project or how many different projects any one user will be a part of.
I don't know if there's a way to accomplish what I want through complicated logic or if there's some way to do it using MySQL. I'm sure that there is some way to do this though.