title: Remove link in supersub category PHP Mysql
body: <p>I have a problem with active link that i've created. I want to make the Sub Category doesn't have any link, only the supersub have link for each supersub category. </p>
  
  <p>The example like: 1. painting (category), 1.1 HOBE (sub category), 1.1.1 Sealer, 1.1.2 Wall Paint (supersub category)</p>
  
  <p>The table contain:
  id_kategori, kategori, id_parent</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;?php
  include "config.php";
  
  function punya_child($id_kategori = NULL)
  {
  $result = mysql_query('SELECT COUNT(id_kategori) AS jumlah_child FROM category WHERE id_parent = \''.$id_kategori.'\'');
  $data = mysql_fetch_assoc($result);
  if($data['jumlah_child'] &gt; 0) return TRUE;    
  return FALSE;
  }
  
  function hirarki($id_kategori = NULL)
  {
     if($id_kategori === NULL)
     {
      $result_top_level = mysql_query('SELECT * FROM category WHERE id_parent IS NULL');        
      if(mysql_num_rows($result_top_level) &gt; 0)
      {
          echo '&lt;ul class="category"&gt;';            
          while($row_top_level = mysql_fetch_assoc($result_top_level))
          {
              echo "&lt;li class='category'&gt;", $row_top_level['kategori'];                
              if(punya_child($row_top_level['id_kategori']))
              {
                  hirarki($row_top_level['id_kategori']);
              }                
              echo '&lt;/li&gt;';
          }            
          echo '&lt;/ul&gt;';
      }
  }
  else
  {
      $result_child = mysql_query('SELECT * FROM category WHERE id_parent = \''.$id_kategori.'\'');    
      if(mysql_num_rows($result_child) &gt; 0)
      {
          echo '&lt;ul class="subcategory"&gt;';        
          while($row_child = mysql_fetch_assoc($result_child))
          {
              echo "&lt;li&gt;&lt;a href='cat.php?kategori=$row_child[kategori]'&gt;", $row_child['kategori'];
              if(punya_child($row_child['id_kategori']))
              {
                  hirarki($row_child['id_kategori']);
              }            
              echo '&lt;/li&gt;';
          }    
          echo '&lt;/ul&gt;&lt;/a&gt;';
      }
  }
  }
  hirarki();
  ?&gt;
  </code></pre>
  
  <p>I really thankful if someone can help me how solve this problem. Thank you</p>