# catalog third level

**URL:** <https://www.phphelp.com/t/catalog-third-level/21663>\
**Category:** General PHP Help\
**Created:** [December 5, 2013, 9:38pm UTC](https://www.phphelp.com/t/catalog-third-level/21663 "2013-12-05T21:38:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://www.phphelp.com/uploads/default/original/2X/2/243e9ed5d93c5653ce3186f18df16e019ce38445.png) [@system](https://www.phphelp.com/u/system)\
**Post date:** [December 5, 2013, 9:38pm UTC](https://www.phphelp.com/t/catalog-third-level/21663/1 "2013-12-05T21:38:52Z")

</div>

Hi all. Thanks in advance. I am having some trouble setting a third level in my catalog.

[php]while($row = mysql\_fetch\_assoc($result))  
{  
if($row[‘nosubs’] == 1)  
{  
$nosubs = ‘-00’;  
}  
else  
{  
$nosubs = ‘’;  
}

```
           if($row['id'] == $currpage[0] && (!isset($currpage[1]) || $currpage[1] == '00'))
           {
           $class = 'catalog_btn catalog_active';
           }
           else
           {
           $class = 'catalog_btn catalog_sub1';
           }

   $bb .= '<li><span class="'.$class.'"><a href="wallcovering-catalog2Test.php?nav=' . $row['id'] . $nosubs . '">' . $row['name'] . '</a></span></li>';

                  if($row['id'] == $currpage[0])
                  {

                       if($CAPP == true && $access != true)
                       {
                       $subs = mysql_query("SELECT name, id, icon, subofsub, nosubs, sub_of FROM directoryTest WHERE sub = '$page' AND published = '1' AND catalog='$catalog' ORDER BY sort_order,id");
                       }
                       else
                       {
                       $subs = mysql_query("SELECT name, id, icon, subofsub, nosubs, sub_of FROM directoryTest WHERE sub = '$page' AND catalog='$catalog' ORDER BY sort_order,id");
                       }

                          while($subcats = mysql_fetch_assoc($subs))
                          {
                               if($subcats['id'] == $currpage[1])
                               {
                               $class = 'catalog_btn catalog_active';
                               }
                               else
                               {
                               $class = 'catalog_btn catalog_sub2';
                               }
                          $bb .= '<li><span class="'.$class.'"><a href="wallcovering-catalog2Test.php?nav=' . $page . '-' . $subcats['id'] . '">' . $subcats['name'] . '</a></span></li>';
                         }

                  if($row['nosubs'] = 2)
                  {

                       if($CAPP == true && $access != true)
                       {
                       $subs = mysql_query("SELECT name, id, icon, subofsub, nosubs, sub_of FROM directoryTest WHERE sub = '$page' AND published = '1' AND catalog='$catalog' ORDER BY sort_order,id");
                       }
                       else
                       {
                       $subs = mysql_query("SELECT name, id, icon, subofsub, nosubs, sub_of FROM directoryTest WHERE sub = '$page' AND catalog='$catalog' ORDER BY sort_order,id");
                       }

                          while($subcats = mysql_fetch_assoc($subs))
                          {

                               if($subcats['id'] == $currpage[1])
                               {
                               $class = 'catalog_btn catalog_active';
                               }
                               else
                               {
                               $class = 'catalog_btn catalog_sub3';
                               }
                          $bb .= '<li><span class="'.$class.'"><a href="wallcovering-catalog2Test.php?nav=' . $page . '-' . $subcats['sub_of'] . $nosubs . '">' . $subcats['name'] . '</a></span></li>';

```

echo $page . ‘-’ . $subcats[‘id’] . ‘-’ . $page2;  
}} }}

[/php]

* * *

So basically. The first level displays icons and a nav list on the side. when you select an icon you are presented with sublevel of that selection. but when i try to add a third level, all of the info/icons gets set to the second level and i cant get past that. Any help would be much appreciated.
