Create levels downline list

Create table with referrer id, if using down line will encounter multiple to one problem.  So I am using referrer id point to member upline, 1 as basic system id. One member only have one reference member,  one member can referrer more than one member.

Table Member:

Member_id Referrer_id
25 1
123 25
136 25
150 123
154 25

Here is one example how I grab member_id as 25 ‘s all downline.

1
$q = "SELECT member_id FROM members WHERE referrer_id = 25;"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!--?php
   function getTotal($products_costs, $tax) {
       $total = 0.00;
       $callback =
             function ($pricePerItem) use ($tax, &amp;$total)
             {
                  $total += $pricePerItem * ($tax + 1.0);
             };
       array_walk($products_costs, $callback);
       return round($total, 2);
}
 -------------------------------------------------------------------------
function slashit(&$aray, $db_link) {
     foreach ($aray as $key => &$value){
         if(is_array($value)) slashit($value, $link);
         else $aray[$key] = mysql_real_escape_string($value, $db_link);
     }
}
// Test: $fruits = array (
"fruits"  => array("a" => "or'ange", "b" => "ban'ana", "c" => "apple'"),
 "numbers" => array(1, 2, 3, 4, 5, 6),
 "holes"   => array("fir'st", 5 => "sec'ond", "thir'd"),
 "odma"    => "jugo'slavija"
);
?-->

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>