title: Codeigniter Recursive Menu not displaying child?
body: <p>Below is the category table</p>
  
  <p><a href="https://i.stack.imgur.com/nFiTK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nFiTK.jpg" alt="enter image description here"></a></p>
  
  <p>My Model</p>
  
  <pre><code>public function get_categories($parent_id = 0){
      $query = $this-&gt;db-&gt;where('parent_id', $parent_id)
                        -&gt;order_by('cat_name', 'ASC')
                        -&gt;get('category');
  
      $return = array();
  
      foreach ($query-&gt;result() as $category){
          $return[$category-&gt;cat_id] = $category;
      }
  
      if($query-&gt;num_rows() &gt; 0){
          foreach ($query-&gt;result() as $cat){
              $return[$cat-&gt;cat_id] = $cat;
          }
          return $return;
      }
      return $return;
  }
  </code></pre>
  
  <p>My view</p>
  
  <pre><code>&lt;div class="navbar-collapse collapse" id="navigation"&gt;
       &lt;ul class="nav navbar-nav navbar-left"&gt;
          &lt;li class="active"&gt;
             &lt;a href="&lt;?php echo base_url();?&gt;member/home"&gt;Home&lt;/a&gt;
          &lt;/li&gt;
          &lt;?php foreach ($categories as $row): ?&gt;
          &lt;li&gt;&lt;a href="#"&gt;&lt;?php echo $row-&gt;cat_name; ?&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;ul class="dropdown-menu"&gt;
                  &lt;li&gt;&lt;a href="#"&gt;&lt;?php echo $row-&gt;cat_name; ?&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;?php endforeach; ?&gt;
       &lt;/ul&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>I want to display the diskpad as a child because not displaying. My mistake is there where? Please help me</p>