Have created a nested repeat region using the Dreamweaver Developer Toolbox which works fine - however, this is for a menu system and only want the second repeat region to show where the Parent ID is the same as the Page ID...script:--------------
--------
HEADERS:
mysql_select_db($database_
conn_Mm, $conn_Mm);
$query_master1navMenu = "SELECT * FROM navMenu WHERE parent IS NULL ORDER BY title";
$master1navMenu = mysql_query($query_master1
navMenu, $conn_Mm) or die(mysql_error());
$row_master1navMenu = mysql_fetch_assoc($master1
navMenu);
$totalRows_master1navMenu = mysql_num_rows($master1nav
Menu);
mysql_select_db($database_
conn_Mm, $conn_Mm);
$query_detail2navMenu = "SELECT * FROM navMenu WHERE parent='123456789' ORDER BY title";
$detail2navMenu = mysql_query($query_detail2
navMenu, $conn_Mm) or die(mysql_error());
$row_detail2navMenu = mysql_fetch_assoc($detail2
navMenu);
$totalRows_detail2navMenu = mysql_num_rows($detail2nav
Menu);
?>
PAGE:
<?php do { ?>
<tr>
<td><b><?php echo $row_master1navMenu['title
']; ?></b></td>
</tr>
<?php if ($totalRows_master1navMenu
>0) {
$nested_query_detail2navMe
nu = str_replace("123456789", $row_master1navMenu['id'],
$query_detail2navMenu);
mysql_select_db($database_
conn_Mm);
$detail2navMenu = mysql_query($nested_query_
detail2nav
Menu, $conn_Mm) or die(mysql_error());
$row_detail2navMenu = mysql_fetch_assoc($detail2
navMenu);
$totalRows_detail2navMenu = mysql_num_rows($detail2nav
Menu);
$nested_sw = false;
if (isset($row_detail2navMenu
) && is_array($row_detail2navMe
nu)) {
do { //Nested repeat
?>
<tr>
<td> &nbs
p;<?php echo $row_detail2navMenu['title
']; ?></td>
</tr>
<?php
} while ($row_detail2navMenu = mysql_fetch_assoc($detail2
navMenu));
//Nested move next
}
}
?>
<?php } while ($row_master1navMenu = mysql_fetch_assoc($master1
navMenu));
?>
--------------------------
---------
This shows the submenus, but constantly - I only want the submenus to appear when the parent ID set in the database is equal to the URL variable '?id=X'
Can get it to show only the submenus that have the parent ID, but it shows them under all menu links.
Any advice??
Thanks,
MNEWM
Start Free Trial