selwonk
09-24-2007, 12:46 PM
Hi folks
Apologies in advance if this has been covered - I couldn't find the answer having done a bit of searching...
I run vBadvanced and I want to produce a thank you box on the front page which shows the latest 10 positive reputation comments. The idea is to promote the reputation system and give people added incentive to give and receive rep points
The information I want is in the reputation and user table. I want to get the following fields:
reputation.postid
reputation.userid
reputation.whoadded
reputation.reason
user.username
I've got this working with the following query:SELECT
reputation.postid,
reputation.userid,
reputation.whoadded,
reputation.reason,
user.username
FROM
reputation
INNER JOIN
user
ON
reputation.userid=user.userid
WHERE
reputation.reputation >= 1 AND
reputation.reason <> ''
ORDER BY
reputation.dateline DESC
LIMIT 10;However, I would also like to map reputation.whoadded to user.username as well. Is it possible to do two INNER JOINs to get this information?
I'd be very grateful of any advice. I'm not feeling well today, and my brain hurts :)
Thanks in advance...
Apologies in advance if this has been covered - I couldn't find the answer having done a bit of searching...
I run vBadvanced and I want to produce a thank you box on the front page which shows the latest 10 positive reputation comments. The idea is to promote the reputation system and give people added incentive to give and receive rep points
The information I want is in the reputation and user table. I want to get the following fields:
reputation.postid
reputation.userid
reputation.whoadded
reputation.reason
user.username
I've got this working with the following query:SELECT
reputation.postid,
reputation.userid,
reputation.whoadded,
reputation.reason,
user.username
FROM
reputation
INNER JOIN
user
ON
reputation.userid=user.userid
WHERE
reputation.reputation >= 1 AND
reputation.reason <> ''
ORDER BY
reputation.dateline DESC
LIMIT 10;However, I would also like to map reputation.whoadded to user.username as well. Is it possible to do two INNER JOINs to get this information?
I'd be very grateful of any advice. I'm not feeling well today, and my brain hurts :)
Thanks in advance...