Jump to content

creating posts category


nielcleo

Recommended Posts

If you want to store categories and posts in a database, then you need a table for each, a table for categories and a table for posts. Each table needs an ID, you need a category ID and a post ID, plus any other fields you want to keep track of. The posts table should have a field for the category ID, which says which category the post is in. If you want to have categories inside categories, then the categories table should have a field for the parent category ID. If that field is 0 then the category doesn't have a parent, or else it has the ID of the parent category.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...