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