Jump to content


Photo

mySQL select COUNT & display problem


  • Please log in to reply
No replies to this topic

#1 nyxtyr

nyxtyr
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 29 March 2006 - 08:43 AM

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

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

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]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users