Hello,
I am trying to create a navigation column for a website that pulls from a database.
The column is broken down into categories with the pages listed underneath each.
The links should look like this:
- Ultrasonic Spray Nozzles
This is test one
This is test two
- Precision Sprayers
Precision Spray Test1
But this is what is showing up using the Query I have:
notice "This is test two" should be under ultrasonic spray nozzles and ultrasonic spray nozzles and precision sprayers should only be showing once.
Here is my code:
<?php
$proQuery = "SELECT DISTINCT(subcat.title), maincat.*, pagepos.*, pagemain.* FROM subcat LEFT JOIN maincat ON subcat.catKey=maincat.catKey LEFT JOIN pagepos ON subcat.subKey=pagepos.subKey LEFT JOIN pagemain ON subcat.pageKey=pagemain.pageKey WHERE maincat.catTitle='Electronics' AND pagepos.type='Products' ORDER BY pagepos.position ASC";
$runPro = mysql_query($proQuery);
while($nav = mysql_fetch_array($runPro)) {
if(str_replace("_", " ", $nav['title']) == $nav['Title']) {
?>
<p>- <a href="splashelectronics.php?cat=<?php print $nav['catTitle']; ?>&subCat=<?php print $nav['title']; ?>&page=<?php print $nav['pageKey']; ?>&pageTitle=<?php print $nav['Title']; ?>&flag=SubCategory" class="blue"><?php print str_replace("_", " ", $nav['title']); ?></a></p>
<?php
}
?>
<div style="font-size: 10px; font-weight: normal; padding-left: 25px;">
<?php
print $nav['Title'] .'<br />';
?>
</div>
<?php
}
?>
If anyone can help I would really appreciate it.