Creating a Blog Engine For Someone - CountOfReplies Question

W

Will Chamberlain

So I'm creating a blog engine for someone and am curious how to go about
creating the count (if any) of the comments for a particular post.
Underneath each post the user will have name of the poster, date, time,
and an option for replying (commenting). I would like to create a count
of replies so that it is displayed. I have a dbBlog (Access) and a table
for the entries and a table for comments. They are tied together with
primary key being id. I understand the concept of doing a rowcount for a
specific id but not for all of the posts. How could I go about doing a
count while binding the entries to the datalist?
 
G

Guest

Select dbBlog.*, Count(dbComments.*) as theCount from dbBlog join dbComments
on dbBlog.blogID = dbComments.blogID.....

you get the idea
 
W

Will Chamberlain

Thanks Curt. I'll be able to try this in about half an hour but was
wondering if the output would look similar to:

ID | TOPIC | MESSAGE | ReplyCount

1 | Test Topic #1 | message #1 | 3
2 | Test Topic #2 | message #2 | 0
3 | Test Topic #3 | message #3 | 8

Thanks again for your feedback.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top