obiwan8472
01-24-2004, 03:12 PM
Hi everyone,
I have a points system installed on my board board (VBr3).
I have several usergroups.. and a fair few public usergroups.
What I want to do is.. add up all the points from certain usergroups. I have an SQL query that does this ok. BUT the problem arises with the membergroupids when the lower numbers appear first.
Heres my current SQL.
SELECT SUM(points) FROM user WHERE usergroupid=13 AND membergroupids=13
usergroupid is fine.. that works. memergroups doesn't though because my test user has joined another group aswell.. so its in the table as 10,13,15.
It doesn't recoginise that he is number 13.. it just thinks his in 10.
Any ideas?
Thanks
I have a points system installed on my board board (VBr3).
I have several usergroups.. and a fair few public usergroups.
What I want to do is.. add up all the points from certain usergroups. I have an SQL query that does this ok. BUT the problem arises with the membergroupids when the lower numbers appear first.
Heres my current SQL.
SELECT SUM(points) FROM user WHERE usergroupid=13 AND membergroupids=13
usergroupid is fine.. that works. memergroups doesn't though because my test user has joined another group aswell.. so its in the table as 10,13,15.
It doesn't recoginise that he is number 13.. it just thinks his in 10.
Any ideas?
Thanks