Welcome Guest, Not a member yet? Register   Sign In
Multi level menu from database section table
#1

[eluser]Aljebrini[/eluser]
hello,

I have section table stored in database, each section have an [ ID, Title, ParentID ]
ID : for section id
Title : Section name
ParentID : For parent section ID .


this would give me tree hierarchy, what i aim to do is to get the hole sections from the database and put it in Multilevel menu ..

Code:
Private $Sections = null ; // this is class member

function _Sections($root){
        
        $this->db->select('id,Name,Parent_ID,MenuTitle');
        $this->db->Where('Parent_ID',$root);
        $this->db->Where('IsActive','Y');
        $query = $this->db->get('sections');
        foreach ($query->result() as $row)
            {
              $this->Section[] = $row->Title;
              $this->_Sections($row->id);

            }
        
        
        $query->free_result();
        
    }

    
function sectionsTree(){
        
        $this->_Sections(0);
        return $this->Section();
    }

but i still haven't the desired values Smile


Messages In This Thread
Multi level menu from database section table - by El Forum - 03-13-2010, 03:25 AM
Multi level menu from database section table - by El Forum - 03-13-2010, 03:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB