SELECT two rows in two tables that must match two values?
Posted: Sun Nov 09, 2008 8:08 pm
I have an interesting goal that has short circuited my brain. 
A small disclaimer: I'm referring to a blog "post" as a "thread" as I've been trying to mimic this in a forum-like approach.
I have a list of blog categories and I'd like to list the total number of published blog threads per category though not include blog threads that are not currently published.
The publish status = thread_status (if it is set to 1, if it's not published it is set to 0).
I've had enough practice with LEFT JOINS to take an educated guess I may need to approach this in a different manner.
Here is at least what I think is relevant database information. I considered storing the thread_status in the blog_xhref_categories table though it would become redundant if the blog thread were published in multiple categories. In example I would categories a blog thread about "Opera 10" in both the categories "Software" and "Web Design & Development". Thoughts please?
Category = '1'
Status = '1'
TABLE: blog_threads
COLUMN: thread_id
COLUMN: thread_status
TABLE: blog_xhref_categories
COLUMN: xhref_id
COLUMN: xhref_category_id
A small disclaimer: I'm referring to a blog "post" as a "thread" as I've been trying to mimic this in a forum-like approach.
I have a list of blog categories and I'd like to list the total number of published blog threads per category though not include blog threads that are not currently published.
The publish status = thread_status (if it is set to 1, if it's not published it is set to 0).
I've had enough practice with LEFT JOINS to take an educated guess I may need to approach this in a different manner.
Here is at least what I think is relevant database information. I considered storing the thread_status in the blog_xhref_categories table though it would become redundant if the blog thread were published in multiple categories. In example I would categories a blog thread about "Opera 10" in both the categories "Software" and "Web Design & Development". Thoughts please?
Category = '1'
Status = '1'
TABLE: blog_threads
COLUMN: thread_id
COLUMN: thread_status
TABLE: blog_xhref_categories
COLUMN: xhref_id
COLUMN: xhref_category_id