php - How do i get downline of userid in a table with mysql -
currently i'm using php , mysql fetch downlines of particular userid. there way can use mysql that. code is......
function downlinesearch($mid, $s) { global $nums; global $str; $q = $cn->query("select userid, concat(lastname,' ',firstname,' ',middlename) name clientsdata (recid '%$s%' or lastname '%$s%' or firstname '%$s%' or middlename '%$s%') , sponsor = $mid"); while($r = $q->fetch_array(mysql_assoc)) { $nums += 1; $str .= "<tr><td valign='middle'>nrn".$r['userid']."ccn</td><td valign='middle'>".$r['name']."</td></tr>"; downlinesearch($r['userid'], $s); } } $str = ''; downlinesearch($mid, 'janet'); echo '<table id="tblsearch" width="100%">'; echo "<tr><td colspan='4' align='center' style='padding-top:10px;'><h3> $nums records found [ <span style='color:red'>".$_post['s']."</span> ]</h3></td></tr>"; echo $str; echo '</table>';`
please highly appreciated. thanks
my guess need set value of $cn, that:
$cn = new mysqli;
does help?
what error message getting?
do know in line error happens?
do have ability debug line-by-line , view variables? if not, add several "echo" statements, view in browser what's going on. or, use error_log(), display info in php error log, if have access it.
(i'm sorry asking clarification in "answer", system not let me add comments other people's question - yet. add clarification, revise "answer" actual answer question.)
Comments
Post a Comment