title: Retrieve one of subcategory
body: <p>I have a category on my database: <a href="http://postimg.org/image/b3p05o7j7/" rel="nofollow">my database</a></p>
  
  <p>and that is the code use to get different levels of subcategories. </p>
  
  <pre><code>&lt;?php
  
  $connect=mysql_connect('localhost', 'root', '') or die('cannot connect mysql');
  mysql_select_db('usertutorial',$connect) or die(mysql_errno());
  mysql_query("set character set utf8");
  
  
  class categories{
  
      public $content=array();
  
      function __construct($id=0, $level=0, $getLevel=false){
      $query = mysql_query("SELECT * FROM categories WHERE parent_id='$id'");
  
          if(mysql_affected_rows() &gt; 0){
              while($this-&gt;content = mysql_fetch_array($query)){
                  $this-&gt;content['level']=$level;
                  if($this-&gt;content['level'] == $getLevel){
                      echo $this-&gt;content['name']."&lt;br/&gt;";
                  }
  
                  $this-&gt;__construct($this-&gt;content['id'], $content['level']+1);
  
              }
          }else{
              return false;
          }
  
      } 
  
  }
  
  
  $category = new categories($getLevel=2);  
  ?&gt;
  </code></pre>
  
  <p>I can get 0 and 1 level sub categories. The problem is when i try to get level of 2nd subcategory with </p>
  
  <p>$category = new categories($getLevel=2);</p>
  
  <p>it just show me "samsung" but it should show "samsung lenovo hp". Please help me to solve this problem. Thank you..</p>