Okay, run this query which should show which user currently has the most referrals.
SELECT referrerid, COUNT( username )
FROM vb_user
WHERE referrerid > '0'
GROUP BY referrerid
ORDER BY `COUNT( username )` DESC
If that works, run this query which will update the vb_user table by adding the value '0' in all referrerid fields that currently hold a value greater than '0'. (This is preferable to using the DELETE function.)
UPDATE vb_user
SET referrerid='0'
WHERE referrerid>'0'
After that, run the first query again which should produce no results because all referrerid fields will have the value '0'.
|