Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
|
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2010, 02:17 AM
Authorized User
 
Join Date: Jan 2010
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mehdymahmood
Default $data[0][$row->parentid]['children'][$row->id] = $row->name

function getCategoriesNav(){
$data = array();
$children = 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;
}

please explain me
$data[0][$row->parentid]['children'][$row->id] = $row->name , where the children come from .

thanks in advance
mehdy
 
Old February 2nd, 2010, 02:19 AM
Authorized User
 
Join Date: Jan 2010
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mehdymahmood
Default $data[0][$row->parentid]['children'][$row->id] = $row->name

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;
}

please explain me
$data[0][$row->parentid]['children'][$row->id] = $row->name , where the children come from .

thanks in advance
mehdy





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chpt 7 >> Pg 245 >>Try It Out #4-5 harrison4411 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 March 2nd, 2006 06:26 PM
ch.14 when extprice is > 999.99 in any row... linkonly BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 March 1st, 2006 11:39 AM
Achitecture ? SQL -> XML -> ASP -> PDF or HTML Frm jstrong Classic ASP XML 0 July 9th, 2005 01:18 PM
VB.Net -> Filename -> DTS Package -> tempdB daniel Pro VB.NET 2002/2003 1 October 7th, 2004 01:46 PM
Manage data row by row in datagrid Dragonist Classic ASP Databases 5 July 29th, 2004 04:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.