Welcome Guest, Not a member yet? Register   Sign In
Showing number of comments in blog (while listing all posts)
#6

[eluser]jegbagus[/eluser]
man, you make it look really hard,
just do simple sql with group query...

example :
assume if you have 2 table (blog , and comment)

Code:
select blog.blog_id, blog.blog_author, blog.blog_insert_date, count(*) as 'total_comment'
from blog, comment
where blog.blog_id = comment.blog_id
group by blog.blog_id, blog.blog_author, blog.blog_insert_date

you should get array result of blog id, blog author, blog insert date, total comment every blog id.

best regards,


Messages In This Thread
Showing number of comments in blog (while listing all posts) - by El Forum - 09-09-2009, 02:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB