• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal error: Cannot use object of type CI_DB_mysql_result as array

#3
[eluser]MEM[/eluser]
I believe that is the first time that I treat him as an array...

Here is the full code:

Code:
private function _parseResultTree($intParentId,&$arrRows,$intDepth,$intRunner)
     {
        
        // stop at this depth
        if($intDepth == $intRunner)
        {
            return array();
        }
    
        $arrChildren = array();

        for($i=0;$i<count($arrRows);$i++)
        {
            if($intParentId == $arrRows[$i]->parent_id_cat) {
                $arrChildren = array_merge($arrChildren,array_splice($arrRows,$i--,1));
            }
        }
    
        $intChildren = count($arrChildren);
        if($intChildren != 0)
        {
            for($i=0;$i<$intChildren;$i++)
            {
                $arrChildren[$i]['children'] = parse_into_tree($arrChildren[$i]['id_cat'],$arrRows,$intDepth,$intRunner++);
            }        
        }
    
        return $arrChildren;
    
    }


thanks a lot,
Márcio


Messages In This Thread
Fatal error: Cannot use object of type CI_DB_mysql_result as array - by El Forum - 09-07-2009, 03:26 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.