HELP! submenu of a submenu from mysql database

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
mengle123
Beginner
Beginner
Posts: 1
Joined: Wed Feb 27, 2008 11:57 pm

HELP! submenu of a submenu from mysql database

Post by mengle123 »

Hi,

I have successfully created a dynamic image-based horizontal menu pulling a list of submenu items (categories) from a mysql database on my php page. The problem is, now I need to pull out a new subset of menu items (pages) related to each category listing.

Ex:

(MENU IMAGE)
submenu item (category)
submenu item (category)
submenu item (category) ------- submenu item (page) (*repeating list of subitems(pages) that apply to category)
submenu item (category)
submenu item (category)



I have the category section pulling down out of the database no problem. The problem is how do I get the related submenu items (pages) to pull out from each category? The pages are stored in a separate table in the database and related to the category table by ID number.

Working in php/MySQL in Dreamweaver CS3 on mac os x Leopard

below is the brief bit of code I have so far on the menu structure.

//To get the recordset//
mysql_select_db($database_cppdc, $cppdc);
$query_Recordset1 = "SELECT * FROM category WHERE category_section = 'Cumberland Plateau Planning District Commission' ORDER BY ID_category ASC";
$Recordset1 = mysql_query($query_Recordset1, $cppdc) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

//Menu Structure//
<!-- QuickMenu Structure [Menu 0] -->
<ul id="qm0" class="qmmc">

<li><a class="qmparent" href="javascript:void(0)"><img class="qm-is qm-ia" src="images/button_cppdc.jpg" width="333" height="45"></a>

<ul>
<?php do { ?>
<li><a href="javascript:void(0);"><?php echo $row_Recordset1['category_category'];?></a></li>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<ul>
<li><a href="javascript:void(0);">item 2</a></li>
</ul></li>
</ul></li>

//item 2 is where the submenu would be a recordset return that contains the pages related to each category row. How do I structure that?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: HELP! submenu of a submenu from mysql database

Post by Ruth »

Hi,

I think you are going to have to contact Milonic direct on this issue.

Ruth
Post Reply