How to count downlines in Laravel?

$i = $_SESSION['ruserid'];// the list will show the downline for a member with id = 10
prin($i);// calling function prin
function prin($i) //definition
{
$id = $i;
// $q=mysql_query("select id from f2_users where up_id='$id'");
$q = User::where('sponser_id', $i)->get();
$count = count($q);// gives new value each time
foreach ($q as $r) {
$i = $r[0];
echo $i;
echo "<br>";
prin($i); // recursion
}
}

How to convert above php code in laravel controller to get downlines?

Blockquote



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3hKS5Wi
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

How to Create Treeview with Bootstrap and jQuery

jQuery Datatables with PHP, MySQL and AJAX Example

How to Add Images to Dropdown List using jQuery