What is the meaning of the following line:
$data[0][$row->parentid]['children'][$row->id] = $row->name
From the function:
function getCategoriesNav(){
$data = array();
$this->db->select('id,name,parentid');
$this->db->where('status', 'active');
$this->db->orderby('parentid','asc');
$this->db->orderby('name','asc');
$this->db->groupby('parentid,id');
$Q = $this->db->get('categories');
if ($Q->num_rows() > 0){
foreach ($Q->result() as $row){
if ($row->parentid > 0){
$data[0][$row->parentid]['children'][$row->id] = $row->name;
}
else{
$data[0][$row->id]['name'] = $row->name;
}
}
}
$Q->free_result();
return $data;
}
Where do the children come from, and what is the meaning of:
$row->parentid or $row->name
?
I don't have any field 'children' in my table, and it's not declared any where. Please help
Thank you in advance, Mehdy