I'm completely clueless when it comes to joins, so please help a brutha out. 😉
Using PHP and MySQL, I've got two tables, "article" and "category". "article" contains the text and info about a news article. "category" is a list of, you guessed it, article categories. Here's a simplified version of my fields:
article:
a_id (a unique ID for the article)
a_title (the title of the article)
a_category (a intiger corresponding to the appropriate article in the category database)
category:
cat_id (a unique ID for the category)
cat_desc (a text description of the category)
With me so far? Here's a simplified version of what I've got in the database:
article (a_id / a_title / a_category):
1 / How to make chitlins / 3
2 / Love with the UPS Guy / 2
3 / Painting your Garage / 4
category (cat_id / cat_desc):
1 / Book Reviews
2 / Romance Stories
3 / Cooking
4 / Home Improvement
When I use a regular select query to display the list of articles, it looks like this:
How to make chitlins / 3
Love with the UPS Guy / 2
Painting your Garage / 4
Okay, so now, what I want to do is use a join (at least I think I do) to display a list of articles along with the text description of the corresponding category in a table that looks like this:
How to make chitlins / Cooking
Love with the UPS Guy / Romance Stories
Painting your Garage / Home Improvement
This is probably simple enough, but, as I said, I ain't that hip to the join coding. Any help would be greatly appreciated! Thanks!