Welcome Guest, Not a member yet? Register   Sign In
Need help with controller and accessing object
#2

(This post was last modified: 04-02-2015, 11:23 AM by ciadmin.)

[eluser]Phil Sturgeon[/eluser]
Sorry, what? You want to access $query in the controller right? Then use $data[\'query\']...

Anyway, you arent able to do it like this. The code should be:

Code:
function get_some_thing($some_var){

    $this->db->select(\'col1\');
    $this->db->select(\'col2\');
    $this->db->select(\'col3\');
    $this->db->where(\'col1\',$some_var);
    
    $data = $this->db->get(\'some_table\');
    return $data->row();
}

Notice how i switched result() to row(). That should sort it out.


Messages In This Thread
Need help with controller and accessing object - by El Forum - 06-21-2007, 04:56 AM
"Need help with controller and accessing object" - by El Forum - 06-21-2007, 05:11 AM
"Need help with controller and accessing object" - by El Forum - 06-21-2007, 06:29 AM
"Need help with controller and accessing object" - by El Forum - 06-21-2007, 07:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB