Hi Everyone,
I am currently trying to list a leaderboard for refferals. The table is set up with the following columns:
id | refferer | user
So obviously if someone reffers someone else they will be in a new row so there are multiple rows per person.
I am trying to use the following code which echos the user the loop is one but wont echo the amount of times they are in the table
<?php
include("includes/db_connect.php");
$select = mysql_query("SELECT refferer FROM refferals");
while($fetch = mysql_fetch_array($select)) {
$current = $fetch['refferer'];
$selectcount = ("SELECT * FROM refferals WHERE refferer = '$current'");
$fetchall = mysql_num_rows($selectcount);
echo $current;
echo " | ";
echo $fetchall;
}
?>
Thanks in advance!