otuatail Posted April 22, 2010 Share Posted April 22, 2010 I have tried to create a CMS website. Everyone has to log in to make any changes to a web page. The user then has a drop down box to select which page he or she want s to change. They then are given a history of the past content of that page and can make changes to a content and pick which content is to be current. My problem is how can I decide in that drop down box which page a user can edit. That means hiding some items from the drop down box. The user table has a userID and the Pages table has a PagesID. How do I do a mix & match system. I need some kind of intermediate tables to link this all together. TIA Desmond. Link to comment https://forums.phpfreaks.com/topic/199432-database-roll-playing/ Share on other sites More sharing options...
ignace Posted April 22, 2010 Share Posted April 22, 2010 The user then has a drop down box to select which page he or she want s to change. They then are given a history of the past content of that page and can make changes to a content and pick which content is to be current. You mean like a version control system? Link to comment https://forums.phpfreaks.com/topic/199432-database-roll-playing/#findComment-1046700 Share on other sites More sharing options...
otuatail Posted April 22, 2010 Author Share Posted April 22, 2010 Well no. I would like that User A would have 1,5,8,10 (pages in the drop down box) User B would have 3,4,8,12 (pages in the drop down box) This is some kind of many to many relationship. If I had 32 users and 16 web pages, I would need some kind of table of 512 rows with 2 colums with spaces where a user can't access a page to edit. This is complcated if you have to a user or page. I was hoping there would be a neat solution. Link to comment https://forums.phpfreaks.com/topic/199432-database-roll-playing/#findComment-1046721 Share on other sites More sharing options...
ignace Posted April 23, 2010 Share Posted April 23, 2010 Any reason why you want someone to be able to only edit certain pages? Are those random? Or are they pre-defined? If so, shouldn't you be able to get those specific records using a FK? Link to comment https://forums.phpfreaks.com/topic/199432-database-roll-playing/#findComment-1046863 Share on other sites More sharing options...
otuatail Posted April 23, 2010 Author Share Posted April 23, 2010 I want to do a site where each department has a page on a website so only a deparment can or would want to edit there page or pages. This is definatly a database problem not a coding problem. It involves seting up some tables to add remove rolls/permissions. So why has Thorpe MOVED this to Coding forum. It is defanatly a database problem. Desmond. Link to comment https://forums.phpfreaks.com/topic/199432-database-roll-playing/#findComment-1046919 Share on other sites More sharing options...
ignace Posted April 23, 2010 Share Posted April 23, 2010 user (id, department_id, ..) page (id, department_id, ..) SELECT * FROM page p, user u WHERE p.department_id = u.department_id Returns all pages for a certain department Link to comment https://forums.phpfreaks.com/topic/199432-database-roll-playing/#findComment-1046987 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.