nyxtyr Posted March 29, 2006 Share Posted March 29, 2006 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_emailFROM article_comment, article, userWHERE article_comment.article_id = article.article_idAND article.user_id = user.user_idGROUP BY article_comment.article_idORDER 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.