Welcome Guest, Not a member yet? Register   Sign In
How to get correct Number of Comments (with 4 connected tables: Art./Cat./Users/Comm.)
#3

[eluser]sigork[/eluser]
[quote author="sigork" date="1248032105"]Is there any obvious problem/error in my code, or how to debug this code?

Thanks![/quote]

I think I found the problem:

Code:
$this->db->select('com_articleid, COUNT(*) AS `comments_count`');

should be replaced with:

Code:
$this->db->select('com_articleid, COUNT(com_articleid) AS `comments_count`');

But I don't understand why that is important.


Messages In This Thread
How to get correct Number of Comments (with 4 connected tables: Art./Cat./Users/Comm.) - by El Forum - 07-26-2009, 02:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB