i am try to create a drop down cms menu in my Website http://4your.co.in/demo2/. Problem is i have used a while loop to show main menu and another while loop to show submenu . Main menu is working but sub menu show online one record . My Code Is .
<?php
include 'config.php';
$page="";
$sql="select * from cms where sub_page='$page' order by pid";
$result = mysql_query($sql);
echo mysql_error();
while($row = mysql_fetch_row($result))
{
echo "<li class='pureCssMenui0'><a class='pureCssMenui0' href=content.php?a=$row[0]><span>$row[1]</span></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->";
$spage=$row[1];
$sq="SELECT *
FROM cms
WHERE sub_page = '$spage'
ORDER BY pid ";
$res = mysql_query($sq);
echo mysql_error();
while($dropdown = mysql_fetch_row($res))
{
echo "<ul class='pureCssMenum'><li class='pureCssMenui0'><a class='pureCssMenui' href=content.php?a=$dropdown[0]>$dropdown[1]</a></li></ul><!--[if lte IE 6]></td></tr></table></a><![endif]--></li>";
}
}
?>
Please Help ME Friends