UBB.Dev
I have 33 forums and I would like to know how many of my members have chosen to receive posts by email. I don't know if I can break it down by forum (ie: forum 1 has 62 members subscribed) or just a total number for all forums.

Thank you for any help you can give.
There are fancier ways to do this, but you can query the table in one of two ways.

SELECT * FROM w3t_Subscribe WHERE S_Board='boardname'

OR

SELECT * FROM w3t_Subscribe WHERE S_Uid='user#'

Replace boardname with your board keyword, and replace user# with the user you want to query.

You could probably stick a COUNT() function in there, but the above will give you the raw results.
Works like a charm, thank you!

Just for giggles, where would I put the count() function if I wanted to use it.

Thanks again.
SELECT COUNT(*) AS Count FROM w3t_Subscribe WHERE S_Board='boardname'

That would give you a number of how many times your 'boardname' was referenced in the Subscription Table.

You could do the same thing to figure out how many boards a particular user subscribed to (if you plugged in user #537, you had 33 boards, and the Count came back 22, he is subscribed to 22 boards).

Have fun.
© UBB.Developers