Hi,
I've managed to display the contents of my menus pulled from my database using the Accordion Menu Script, but I'm having trouble with html validation.
This is the code for the menu:
<div class="arrowlistmenu">
<div class="menuheader"><a href="index.php">HOME</a></div>
<?php
// Assuming main menu items have a null menu_sub_id
$query = "SELECT * FROM ddcart_menu WHERE parent = '0'";
$sideMenuItems = mysql_query($query);
// Loop through each top menu item
while($row = mysql_fetch_assoc($sideMenuItems)) {
echo "<div class='menuheader expandable'><a href='page.php?id={$row['id']}'>{$row['name']}</a></div>";
$querysideSubMenu = "SELECT * FROM ddcart_menu WHERE parent = '".$row['id']."'";
$subsideMenuItems = mysql_query($querysideSubMenu);
$i = 0;
$sidenum = mysql_num_rows($subsideMenuItems);
if(++$i > 0) {
echo ' <ul class="categoryitems">';
// Iterate through each sub menu item for this menu
while ($sidesubItem = mysql_fetch_assoc($subsideMenuItems)) {
echo "<li><a href='page.php?id={$sidesubItem['id']}'>{$sidesubItem['name']}</a></li>";
}
echo '</ul>';
}
}
?>
</div>
The validation error is:
end tag for "ul" which is not finished
…/div> <ul class="categoryitems"></ul><div class='menuheader expandable'><a hr
The test site is HERE
Anyone got any suggestions on how I can get it to validate?
Thanks!