Here is what I\'m trying to do: - i need a function that when passed as an argument an ID (for a category of things) will provide all the subcategories and the sub-sub categ
<?php
require('db/dbconnect.php');
$user_id='triD-100';
$sql="select * from ajent_joining where sponser_id='".$user_id."'";
$qR=mysql_query($sql);
while($rowD=mysql_fetch_assoc($qR)){
echo $childId=$rowD["user_id"];
echo "<br/>";
categoryChild($childId);
}
function categoryChild($childId) {
$s = "select user_id from ajent_joining where sponser_id='".$childId."'";
$r = mysql_query($s);
if(mysql_num_rows($r) > 0) {
while($row = mysql_fetch_array($r)) {
echo $childId=$row["user_id"];
echo "<br/>";
categoryChild($childId);
}
}
}
?>