Need some db design help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Need some db design help

Post by Burrito »

I am going to be creating a new application that will be a "registration" system as an interface between the end users and different modules they can access.

The different modules they can access will be dependent on whether they've purchased the modules or not.

In a nutshell, I need to assign access to the different modules to the users and I'm trying to figure out the best way to do this. Each of the modules will be assigned a number (ex: 1-25). I was thinking about just creating a field on my users table and separating the different modules to which they should have access by commas and then throwing that list into an array when they hit the reg system. Some time in the past though (for something very similar), someone (probably Feyd) told me that I should probably set up another table that houses all of the modules with the user ID and modules to which they have access and run everything off of that.

From an administrative standpoint I think the latter idea would probably be easier because it'd be a lot easier to just delete a row from the other table than to have to remove one item from the comma delimted list should we ever need to remove a module (same for adding).

can someone think this over and let me know the best solution...if there's another solution you think would be better...I'm open to suggestions.

thx,

Burr
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yeah, a seperate table concerning access rights to this where one field links to the user/account and the other links to each module. Each record is a single user and a single module. To determine access, you can then do a join against the user and their accessible modules.. quite simple actually.
Post Reply