Welcome Guest, Not a member yet? Register   Sign In
Messing Arround With CI
#1

[eluser]Rost[/eluser]
I am messing around with CI, but stood on a problem.

When I am trying to echo my sitetitle I get a error:
Quote:<h4>A PHP Error was encountered</h4>

<p>Severity: Notice</p>
<p>Message: Trying to get property of non-object</p>
<p>Filename: views/index.php</p>
<p>Line Number: 4</p>

This line is:
Code:
&lt;title&gt;&lt;?=$s->f_sitetitle; ?&gt;&lt;/title&gt;

The Model's code is:
Code:
function getSettings(){
     $q = $this->db->get('tbl_settings');
     if($q->num_rows() > 0){
     foreach($q->result() as $row)
        {
         $data[] = $row;
        }
        return $data;
     }
    
    }

The Controllers code is:
Code:
function index()
     {
      $this->load->model('data_news');
      $this->load->model('data_overall');

          $data['news'] = $this->data_news->getNews();
          $data['s'] = $this->data_overall->getSettings();
        
      $this->load->view('index', $data);
     }

I can't solve it, trying the whole morning. I hope you can help me


Messages In This Thread
Messing Arround With CI - by El Forum - 08-11-2009, 05:05 AM
Messing Arround With CI - by El Forum - 08-11-2009, 05:18 AM
Messing Arround With CI - by El Forum - 08-11-2009, 05:24 AM
Messing Arround With CI - by El Forum - 08-11-2009, 05:37 AM
Messing Arround With CI - by El Forum - 08-11-2009, 05:50 AM
Messing Arround With CI - by El Forum - 08-11-2009, 05:56 AM
Messing Arround With CI - by El Forum - 08-11-2009, 06:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB