sanjayshiwakoti Posted March 7, 2007 Share Posted March 7, 2007 i'm making a hierarchical Order list for this i've created database where parameter_cd,parameter_desc,upper_parameter_cd my page is like this $Sql="select p.parameter_cd, p.parameter_desc, p.upper_parameter_cd, level, (select count(*) from parameter WHERE parameter_cd <> p.parameter_cd start with parameter_cd = p.parameter_cd connect by prior parameter_cd = upper_parameter_cd and upper_parameter_cd=p.parameter_cd ) no_of_childs from parameter p start with upper_parameter_cd is null connect by prior parameter_cd = upper_parameter_cd"; $objTree=new Sandee; $objTree->dbQuery($Sql); <ul id="dhtmlgoodies_tree2" class="dhtmlgoodies_tree"> <? $old_value_level=NULL; $old_upper_cd=NULL; $counter = 0; $no_of_childs =array(); $i=0; while($dataTree=$objTree->dbFetchArray(1)){ ?> <li id="node<?=$dataTree['PARAMETER_CD']?>"><a href="#"><?=$dataTree['PARAMETER_DESC']?></a> <? if($dataTree['NO_OF_CHILDS']>0){ print "<ul>"; }else if($dataTree['NO_OF_CHILDS']==0){ print "</li>"; } if(($no_of_childs == 0 && trim($no_of_childs)!= '')) print "</ul></li>"; //I know here is the error //Couln't find the logic else{ $no_of_childs--; } ?> <? $old_value_level=$dataTree['LEVEL']; } ?> </ul> This is true if there is only up to two child but in multiple child it can't display the data properly Please any sugession Link to comment https://forums.phpfreaks.com/topic/41596-dynamic-list-content-help/ Share on other sites More sharing options...
sanjayshiwakoti Posted March 11, 2007 Author Share Posted March 11, 2007 Please Help me or this difficult question to you Link to comment https://forums.phpfreaks.com/topic/41596-dynamic-list-content-help/#findComment-204706 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.