Joseph Witchard Posted November 4, 2008 Share Posted November 4, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/131385-a-blog-category-table/ Share on other sites More sharing options...
Barand Posted November 4, 2008 Share Posted November 4, 2008 I'm guessing that it's either done via a JOIN query or through the use of foreign keys, Both. http://www.phpfreaks.com/tutorial/data-joins-unions Quote Link to comment https://forums.phpfreaks.com/topic/131385-a-blog-category-table/#findComment-682529 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.