I'm designing a bookshelf page for my website, and I'm not sure how to use the Join function in my select. Here's the problemo:
I want to display a list of books, sorted by categories. I've got two tables:
book - with fields:
"book_id" integer of unique id number of the book "book_cat" a integer corresponding to a category in the "category" table
"title" the book title
"author" the book's author
and
category - with fields:
"cat_id" - integer or a unique id number of each category
"catdesc" - text description of the category
Basically I want to be able to display the HTML table to show up like this:
Category A
Book Title I by Author I
Book Title II by Author II
Category B
Book Title III by Author III
Book Title IV by Author IV
etc etc.
I know it's possible to use a Join in the Select Query, but I'm clueless on how to phrase the query. Any help would be greatly appreciated!
I want to display a list of books, sorted by categories. I've got two tables:
book - with fields:
"book_id" integer of unique id number of the book "book_cat" a integer corresponding to a category in the "category" table
"title" the book title
"author" the book's author
and
category - with fields:
"cat_id" - integer or a unique id number of each category
"catdesc" - text description of the category
Basically I want to be able to display the HTML table to show up like this:
Category A
Book Title I by Author I
Book Title II by Author II
Category B
Book Title III by Author III
Book Title IV by Author IV
etc etc.
I know it's possible to use a Join in the Select Query, but I'm clueless on how to phrase the query. Any help would be greatly appreciated!
