I have a database named "user" with the following fields
1) username
2) userid
3) referrerid
Right now there are a total of 3 users that have a total of 4 referrals which there userid is placed in the referred members referrerid field.
I have ran the following query at it shows an accurate result:
An accurate total of 4 referrals in the database.
$gettotal=$DB_site->query_first("SELECT COUNT(*) AS ttl FROM user WHERE referrerid >0");
$echo $gettotal['ttl'];
I'm trying to make a query that will count the total number of referrals in the database that are made by each member. So basically if there is a user named test and he has referrered 2 members and the others referred only one. Then the accurate total resulted for $gettotal['ttl'] would be 3
ANY IDEAS?? PLEASE I DO APPRECIATE IT.