Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 6th, 2012, 03:14 AM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
)

)

)

)
Reply With Quote
  #2 (permalink)  
Old June 6th, 2012, 03:53 AM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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;

}
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Group Meeting - MAY-2008 tariq.younas User Group Events - INETA 0 April 27th, 2008 10:01 AM
Huntsville (AL) November 14 meeting lkmckinney User Group Events - INETA 0 October 17th, 2006 10:52 AM
Meeting a Problem about BegEcom chapter 3 shxj99 Wrox Book Feedback 6 September 7th, 2004 09:29 AM



All times are GMT -4. The time now is 07:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.