hi i have been trying to sought out a recursive hierarchical menu populated
from mysql how is this possible ? i have tried this but doesnt work
   $result = $db->query("SELECT * FROM mainsection ms LEFT JOIN subsections
ss ON ms.sectionID=ss.mainsectionID ORDER BY ms.sectionID,ss.subsectionID");
while ($menu = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
   $section = $menu["section"];
   $sectionID = $menu["sectionID"];
   $subsection = $menu["subsection"];
   $subsectionID = $menu["subsectionID"];
   $mainsectionID = $menu["mainsectionID"];
   if ($mainsectionID=$sectionID) echo "$section<br>$subsection<BR>";  else
echo "$section<br>";
 }





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

Reply via email to