Undefined variable: listing - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Undefined variable: listing (/showthread.php?tid=48034) |
Undefined variable: listing - El Forum - 01-02-2012 [eluser]ppwalks[/eluser] Hi all, I was wondering if I could get some help, i am new to codeigniter and a recent graduate from university and i am taking my first plunge into the MVC world. I recently purchased a book call "Professional Codeigniter" from the group wrox and within it is a project for a website (don't know if anyone has read if so you'll know the code probably..), the book itself hosts great opportunity to learn many of the concepts involved with making a great dynamic website but it also hosts a lot of errors which the author does tend to address on his support forum but for the last few months it seems to have stopped which led me to this forum to ask for help. Anyway enough rambling on with the problem; I am creating a category view for the products and I have spent 3 days trying to solve one issue which is now driving me mad. i have already fixed a numerous amount of errors but this one has got me tied up. Model Code: function getCategory($id){ Controller Code: function cat($id){ Code: <div id='pleft'> The error generated is; A PHP Error was encountered Severity: Notice Message: Undefined variable: listing Filename: views/category.php Line Number: 5 AND A PHP Error was encountered Severity: Warning Message: Invalid argument supplied for foreach() Filename: views/category.php Line Number: 5 |