Thread: Count Problem
View Single Post
Old 01-12-2005, 06:31 PM   #2 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
Not sure what subject_title or postComment (is this the comment text?) has to do with anything since it seems like each blog entry has a unique numeric ID. (I assume that is what blog_entries_id and blog_id are)

A simple query might be:
Code:
select count(*) as bcount
from postreply
where blog_id=4
..obviously replacing 4 with the current blog_entries_id that you're counting for. The easiest way is to do this in two queries. One to fetch the date/subject/etc for the blog then another (similar to above) to count the comments.

-r
idx is offline   Reply With Quote