PHP interesse |
|
ik heb deze query :
SELECT
newz.id,
newz.post_date,
newz.edit_date,
newz.msg,
COUNT(DISTINCT reaction.newz_id ) AS reaction_count,
users.user
FROM
newz
LEFT JOIN
users
ON
newz.poster_id = users.id
LEFT JOIN
newz_reactions AS reaction
ON
newz.id = reaction.newz_id
GROUP BY
reaction.id
ORDER BY
id DESC
LIMIT 5
SELECT newz.id, newz.post_date, newz.edit_date, newz.msg, COUNT(DISTINCT reaction .newz_id ) AS reaction_count , users.user FROM newz users ON newz.poster_id = users.id newz_reactions AS reaction ON newz.id = reaction.newz_id GROUP BY reaction.id ORDER BY id DESC LIMIT 5
Maar ik krijg maar 1 result, terwijl er meerdere items zijn in de tabel newz, dit heb ik nagechecked met php my admin. Er is dus iets mis met deze query maar ik zie niet wat , ziet iemand wat het is ?
|