I am using following my sql query…
SELECT p.id, p.title, p.description, p.game, p.icon, p.comments_allowed, p.views, p.dnt, u.id AS poster_id,
u.username AS posted_by, u.icon AS poster_icon, COUNT(c.id) AS total_comments
FROM ne_posts p
LEFT JOIN ne_users u
ON u.id = p.posted_by
LEFT JOIN ne_comments c
ON c.id = p.id
WHERE p.game = "game1" LIMIT 4
but there are not any row for game1 in posts table, but its still returning row with all values as NULL. What’s am i doing wrong? please help, thanks.
You have an aggregate function (COUNT) with no GROUP BY clause on the query.