Problem with passing data to view in codeigniter code.
Posted
by Jagira
on Stack Overflow
See other posts from Stack Overflow
or by Jagira
Published on 2010-03-20T16:39:26Z
Indexed on
2010/03/20
16:41 UTC
Read the original article
Hit count: 344
php
|codeigniter
Hello,
I have a codeigniter code that is working on local Apache installation. But it does not work on Godaddy Hosting.
I have got other similar views and controllers which are working on Godaddy.
Following is the code. I have pasted only relevant code.
Controller:
function index() { $this->load->model('Feedmodel'); $data['posts']=$this->Feedmodel->gethomedata(); $this->load->view('home',$data); }
View:
Total' .$post['title'].''; ?>
The error that I am getting is
A PHP Error was encountered Severity: Notice
Message: Undefined variable: posts
Filename: views/home.php
Line Number: 59
A PHP Error was encountered Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: views/home.php
Line Number: 59
© Stack Overflow or respective owner