Welcome Guest, Not a member yet? Register   Sign In
Select Query
#1

[eluser]Unknown[/eluser]
Hi,

I am trying to perform a simple select query in CI. No coditions at this point or anything like that, just simply Select * From 'table' and pass this to a controller and then onto a view.

I'm sure this is really simple but im unable to get it to work. Im constantly receiving the error 'undefinded variable' etc.

here is my model.

Code:
function featured_list()
{
  
  $this->db->select();  
  $query = $this->db->get('featured');
  return $query->result();
  
}

and my controller

Code:
$this->load->model('featured');
$query['name'] = $this->featured->featured_list();
    
// Load 'liked' view
$this->template('liked', $query);

In my view I just have a var_dump($query);

Any help would be great.

Thanks


Messages In This Thread
Select Query - by El Forum - 09-14-2012, 03:31 AM
Select Query - by El Forum - 09-14-2012, 04:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB