![]() |
blog lesson - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: blog lesson (/showthread.php?tid=4211) Pages:
1
2
|
blog lesson - El Forum - 11-13-2007 [eluser]anjelo[/eluser] Hi can help me? following the lesson blog in the tutorial I've founded an error: "A PHP Error was encountered Severity: Notice Message: Undefined variable: db Filename: controllers/blog.php Line Number: 14 Fatal error: Cannot access empty property in C:\Programmi\EasyPHP 2.0b1\www\CodeIgniter\system\application\controllers\blog.php on line 14" HELP blog lesson - El Forum - 11-13-2007 [eluser]mistress_shiira[/eluser] have you loaded the database like this: $this->load->database(); if you have and you still have that error,kindly check your config file... blog lesson - El Forum - 11-14-2007 [eluser]anjelo[/eluser] Thank's, I resolved, the trouble is in the tutorial blog, the database is loaded in the librry array not in the core, in autoload.php. Thank's blog lesson - El Forum - 11-14-2007 [eluser]ELRafael[/eluser] that video tutorial is too old. But if you read the autoload file you'll see an explaination! blog lesson - El Forum - 01-12-2008 [eluser]WavyDavy[/eluser] [quote author="ELRafael" date="1195071490"]that video tutorial is too old. But if you read the autoload file you'll see an explaination![/quote] Thanks ELRafael, Your response helped me solve the same problem, I simply removed the $autoload['core'] = array('database'); that I had and replaced it with the following code that was in the autoload commnts $autoload['libraries'] = array('database', 'session', 'xmlrpc'); Edit: I only managed to get a little further until I reached the point where I was using the anchor property from the url helper, then I started getting an error that said this; A PHP Error was encountered Severity: Notice Message: Undefined variable: anchor Filename: views/blog_view.php Line Number: 13 blog lesson - El Forum - 01-12-2008 [eluser]WavyDavy[/eluser] Bump! Can anyone help? blog lesson - El Forum - 01-12-2008 [eluser]Sarre[/eluser] Did you load the url helper? $this->load->helper("url"); blog lesson - El Forum - 01-12-2008 [eluser]Seppo[/eluser] It says undefined variable anchor... and anchor is a function... Are you using $anchor? you have to use Code: anchor('path/to/url', 'title'); blog lesson - El Forum - 01-12-2008 [eluser]WavyDavy[/eluser] This is the code I have: blog.php Code: <?php and this is the code for blog-view.php Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> The code is exactly the same as the tutorial, but in the tutorial he does this wierd thing where he doesnt put the comments table in until well after he has written this code, he even deliberately tests this code so he gets error 404 pages so he can show the path url in the browser. Its like he is doing things back to front, shouldnt he have created the comments table before writing this code? I am going to try creating a comments table and see what this does. blog lesson - El Forum - 01-12-2008 [eluser]Sarre[/eluser] As Seppo said: remove the "$" in front of the anchor-call: Code: <p><?=$anchor("blog/comments/".$row->id, "Comments");?></p> Code: <p><?=anchor("blog/comments/".$row->id, "Comments");?></p> |