
May 3rd, 2002, 05:48 AM
|
|
Junior Member
|
|
Join Date: May 2002
Location: London
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Creating a menu driven Menu System with PHP
Hello...
I've had a look at the arictle, and found it very interesting however I don't want to use DHTML to display the subcategories, can this be done without??
I've made a start on this
PHP Code:
function maketree($rootcatid,$sql,$max_level)
{
$result=mysql_query($sql);
list($DBcatid,$DBparentid,$DBcatname)=mysql_fetch_ row($result);
$display=$DBcatname;
RETURN $display;
}
<form action="showquiz.php" method="post">
<table border="1" cellpadding="2" cellspacing="2" width="70%">
<tr>
<td valign="top"><b>What Category?</b>:</td>
<td>
<?
if (!isset($id)) $id=0;
$query="select * from quiz_category
where parentid=$id
order by cat_name";
maketree($id,$query);
?>
</td>
</tr>
<tr><td><b>How many?</b>:</td><td><input type="text" name="num" size="5"></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Add Questions" name="submit"></td></tr>
</table>
<input type="hidden" name="qzid" value=<? echo $qzid; ?>>
</form>
Am I on the right track here?? I think I need to pass $DBcatid which will then display the items beneath??
I dont know...
THanks
Oz
|