I'm under a deadline, and for whatever reason, can't figure out why this snippet of 
code isn't working.  I'm trying to build a site map function, (parent,child 
relationship based on id).

It almost works, but I can't get the indent feature to work correctly.  Any thoughts?

here's the code:

$thequery="select * from items where type='main'";

$theresults=mysql_query($thequery) or die(mysql_error());

function outputTree($parentid,$level)

$query="select id,name from items where whichpage='$parentid'";

$treeresults=mysql_query($query) or die (mysql_error());
while ($treebranch=mysql_fetch_assoc($treeresults))

for ($i = 0; $i < $level; $i++)
echo "&nbsp;&nbsp;";
echo "$treebranch[name]<br>";

//end function

while ($output=mysql_fetch_assoc($theresults))
echo $output["name"]."<br>";


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to