I am trying to make my dynamic site in php by learning from tutorials and google search. I am stuck in one place.
I want sub-menu from the database i.e SQL. so when user add category in category section in sql then sub should come from the entered categories but it appears empty . Here is the code
<ul class="menu">
<li><a href="index.php">Home</a></li>
<li><a href="about-us.php">About Us</a></li>
<li><a href="#">Products</a>
<ul class="submenu pop">
<?php
$result = mysqli_query ($con,"SELECT CategoryId,CategoryName FROM category ORDER BY CategoryId ASC");
while ($row=mysqli_fetch_array($result))
?>
<li><a href='#'><?php echo $row['CategoryName'];?></a></li>
</ul>
</li>
<li><a href="construction.php">Directors</a></li>
<li><a href="contact-us.php">Contact Us</a></li>
</ul>
Also please tell me any easiest way for pagination.