PHPFAN10 Posted July 16, 2011 Share Posted July 16, 2011 Hi, I decided to build my own CMS. It's like a blog but with groups, users etc. Basically i have been developing it for past day and so far everything is working as expected. Currently when adding a new post to the site i have a dynamic category that displays all categories from database and i then select which category i want they post to appear in. The problem i am having is how do i go about making it so i can select more than one category for the post to display in ? I have searched high and low online for a tutorial that could perhaps explain the concept but so far cannot find anything. Here is my database design as it stands, it will be altered slightly and improved as i add new things etc but at the moment this is the design Uploaded with ImageShack.us as you can see i have a categories table and posts aswell as the others tables but wondering if someone could explain the concept on what i would need to do to make it so i can select multiple categories. another concept i don't know how the logic works is, if i delete a category and there are posts in that category what logic would a developer use to keep the post but perhaps place it in another category ? Thanks for any help. PHPFAN Link to comment https://forums.phpfreaks.com/topic/242135-need-help-understanding-the-logic-of-multiple-category-selection/ Share on other sites More sharing options...
TeNDoLLA Posted July 16, 2011 Share Posted July 16, 2011 To make the post display in multiple categories you could do a link table between posts and categories. And to keep the deleted posts/categories in history I see atleast two possible choices. Make a history table for the posts/categories and when they are deleted you move them to these history tables. Or you could add a field to categories/posts e.g called deleted (TINYINT(1)) where 1 indicates that they are deleted and 0 (default) that they are not. Not sure thought if I got what you are after. I could be telling stories. Link to comment https://forums.phpfreaks.com/topic/242135-need-help-understanding-the-logic-of-multiple-category-selection/#findComment-1243529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.