Something similar but WAY more messy than yours
However the 100,200,300 where just examples, in an actual forum it should go through all the userids

Well, that's not very hard to change, I'll just put instead of your WHERE a WHERE referrerid>0 (cause I want it to only return the users with a referrer)
Thanks so much!! That's much more organized than my code. I'm still trying to figure out how those SQL things work, it's quite hard :nervous:
edit: And it works too! Woo hoo!!

Thanks, thanks, thanks!!!