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 June 6th, 2012, 03:14 AM
Registered User
 
Join Date: Jun 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb getting error after css update with cluadias second meeting

error is as under

A PHP Error was encountered
Severity: Notice

Message: Undefined index: name

Filename: views/navigation.php

Line Number: 20


and code on line is

echo anchor("welcome/cat/$topkey",$toplist['name']);


but after making the print_r i found that name is not getting printed actual expectation as per book is

Array
(
[0] = > Array
(
[7] = > Array
(
[name] = > clothes<-----this line not appears in my print_r function.
[children] = > Array
(
[4] = > dresses
[3] = > pants
[2] = > shirts
[1] = > shoes
)
)

= > Array
(
[name] = > fun
[children] = > Array
(
[6] = > games
[5] = > toys
)
)
)
)


and what i get is



Array
(
[0] => Array
(
[2] => Array
(
[children] => Array
(
[7] => clothes
)

)

[7] => Array
(
[children] => Array
(
[3] => pants
[2] => shirts
[1] => shoes
)

)

=> Array
(
[children] => Array
(
=> fun
[6] => games
[5] => toys
)

)

)

)
 
Old June 6th, 2012, 03:53 AM
Registered User
 
Join Date: Jun 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default mcat model of above question

function getCategoriesNav()
{
$data=array();

$this->db->select('id,name,parentid');

$this->db->where('status','active');

$this->db->order_by('parentid','asc');

$this->db->order_by('name','asc');

$this->db->group_by('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;<--this part gives error
}
else
{
$data[0][$row->id]['name']=$row->name;
}
}
}

$Q->free_result();

echo "<pre>";
print_r($data);
echo "</pre>";
return $data;

}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Meeting a Problem about BegEcom chapter 3 shxj99 Wrox Book Feedback 6 September 7th, 2004 09:29 AM





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