Need to get all referrals ID with using MYSQL
- by Fero
Hi all,
I having a referral table like below.
> id referredByID referrerID
>
> 1001 1 2
>
> 1002 2 3
>
> 1003 2 4
>
> 1004 5 7
From the above table structure i need to get the users whom i referred and the users whom are referred by their referrals.
For Example:
I am referredByID-1
I referred the ID - 2
Now the ID - 2 referred ID -3
And in the same case ID-2 referred ID - 4
Now my output needs to be look like:
Referrals Done By Me:
id - 2
id - 3
id - 4
How can this be done using MYSQL.
Any help will be appreciated.. Thanks in advance...