CodeIgniter Forums
Data not transfering to page view - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Data not transfering to page view (/showthread.php?tid=46760)

Data not transfering to page view - El Forum - 11-14-2011


I'm new to CI and i've been testing to see how you pass code from model, controller and view.

I have the following code which should pass $data array to blog.php.

But when i pull up the page in a web browser I get the following message;-

Message: Undefined variable: result Filename: views/blog.phpLine Number: 9

I have echoed the $data from the controller and the result is array. But the array does not pass to the blog.php


class Blog_controller extends CI_Controller {

    function index()

        $data['query'] = $this->Blogmodel->get_last_ten_entries();

        $this->load->view('blog', $data);


Thanks any help would be grateful.