dptr1988 Posted June 14, 2006 Share Posted June 14, 2006 I have a list of users and a list of files and I want to use MySQL to decide which user can access which file. I was thinking of create one table for the users and another one for the files. Then each entry in the file table would say which user could access it. But how can I make it so I can have multiple users in each file table entry? Do you have any suggestions on the basic structure of the tables?Thanks Quote Link to comment https://forums.phpfreaks.com/topic/11935-need-advice-on-making-a-table/ Share on other sites More sharing options...
fenway Posted June 14, 2006 Share Posted June 14, 2006 You're right to keep a separate table of files and users -- you just need a third table where you assign permissions and "link" files to users. Quote Link to comment https://forums.phpfreaks.com/topic/11935-need-advice-on-making-a-table/#findComment-45390 Share on other sites More sharing options...
dptr1988 Posted June 14, 2006 Author Share Posted June 14, 2006 Thank you, fenway, for helping me!! That third table is what I couldn't figure out. dptr1988 Quote Link to comment https://forums.phpfreaks.com/topic/11935-need-advice-on-making-a-table/#findComment-45589 Share on other sites More sharing options...
kharbat Posted June 14, 2006 Share Posted June 14, 2006 the third table could be this way1- [u]User ID , File ID[/u] (composite primary key)2- Permission (non key attribute) Quote Link to comment https://forums.phpfreaks.com/topic/11935-need-advice-on-making-a-table/#findComment-45623 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.