[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