Jump to content

mySQL select COUNT & display problem


nyxtyr

Recommended Posts

my problem is that my code only displays my posts that have comments, and i want it to display all news posts and to show how many comments they each have, i think i may have to pull two queries to do this, but not sure how or even if i would have to

[code]SELECT COUNT(article_comment.article_id), article.article_title, article.article_content, article.article_submitted, user.user_name, user.user_email
FROM article_comment, article, user
WHERE article_comment.article_id = article.article_id
AND article.user_id = user.user_id
GROUP BY article_comment.article_id
ORDER BY article.article_submitted ASC
[/code]

posted this on
[a href=\"http://www.phpfreaks.com\" target=\"_blank\"]http://www.phpfreaks.com[/a] : [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=89608\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=89608[/a]
[a href=\"http://www.neverside.com\" target=\"_blank\"]http://www.neverside.com[/a] : [a href=\"http://forums.neverside.com/thread/92438/\" target=\"_blank\"]http://forums.neverside.com/thread/92438/[/a]
[a href=\"http://www.mysqlfreaks.com\" target=\"_blank\"]http://www.mysqlfreaks.com[/a] : [a href=\"http://www.mysqlfreaks.com/forums/index.php?showtopic=9155\" target=\"_blank\"]http://www.mysqlfreaks.com/forums/index.php?showtopic=9155[/a]
[a href=\"http://www.sitepoint.com\" target=\"_blank\"]http://www.sitepoint.com[/a] : [a href=\"http://www.sitepoint.com/forums/showthread.php?t=363607\" target=\"_blank\"]http://www.sitepoint.com/forums/showthread.php?t=363607[/a]


problem solved here [a href=\"http://www.sitepoint.com/forums/showpost.php?p=2616828&postcount=2\" target=\"_blank\"]http://www.sitepoint.com/forums/showpost.p...828&postcount=2[/a]
Link to comment
https://forums.phpfreaks.com/topic/6079-mysql-select-count-display-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.