Jump to content

A Blog Category Table


Joseph Witchard

Recommended Posts

A posts table would have the following information in the database: post_id, title, author, date, body. It would also have a category (such as "music," to just give an example), which would also need to be displayed on the blog. However, the category isn't in the posts table, but rather in the categories table. How would you get the proper category to display with your blog post when the database output it to the browser? I'm guessing that it's either done via a JOIN query or through the use of foreign keys, but if it's either one of those, I have no idea where to begin. Could someone give me an example?

 

Link to comment
https://forums.phpfreaks.com/topic/131385-a-blog-category-table/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.