Hi Guys,
Need a little bit of help. I am trying to create a blog like feature that has the number of comments for that blog displayed underneath.
The database (access) has two tables, listed below..
-------
blog
-------
id
title
message
datewritten
---------------
comments_blog
---------------
id
comment
datewritten
username
blogid
Im having problems creating the sql for this to work. I can get the count and the blog to work seperately but not together.
Heres what I have thus far..
Please help me..
Need a little bit of help. I am trying to create a blog like feature that has the number of comments for that blog displayed underneath.
The database (access) has two tables, listed below..
-------
blog
-------
id
title
message
datewritten
---------------
comments_blog
---------------
id
comment
datewritten
username
blogid
Im having problems creating the sql for this to work. I can get the count and the blog to work seperately but not together.
Heres what I have thus far..
Code:
sqlquery = "SELECT * FROM blog INNER JOIN(SELECT COUNT(*) FROM comments_blog WHERE blogID = blog.id) ON blog.id = comments_blog.blogid"