Welcome Guest, Not a member yet? Register   Sign In
Extenstion of blog tutorial -> Counting the Comments
#2

[eluser]deviant[/eluser]
The SQL query I was using for counting comments on news items was something along the lines of

Code:
SELECT news.*, COUNT(comment.id) AS num_comments FROM news LEFT JOIN comment ON (comment.post_id=news.id) GROUP BY news.id ORDER BY news.date_posted DESC


Messages In This Thread
Extenstion of blog tutorial -> Counting the Comments - by El Forum - 08-10-2007, 01:49 AM
Extenstion of blog tutorial -> Counting the Comments - by El Forum - 08-10-2007, 02:53 AM
Extenstion of blog tutorial -> Counting the Comments - by El Forum - 08-10-2007, 04:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB