Welcome Guest, Not a member yet? Register   Sign In
Can somebody help me please?
#1

[eluser]Christophe28[/eluser]
Hello,

I have a 2 variables which I have available in a method. I want to pass these to the model, but I don't know how.

I'm new in CI and OOP -> but I hope somebody can help me ...

For now I have:


Code:
function photo_view_function($username, $caption)
    {
        // loading the model
        $this->load->model('mediamanager_model', array('caption' => $caption, 'username' => $username));
        $data['photo'] = $this->mediamanager_model->getSinglePhoto();

        $data['caption'] = str_replace('_', ' ', $caption);

        $data['main_content'] = 'single_photo_view';
        $this->load->view('template', $data);

    }

And the model
Code:
function getSinglePhoto($username, $caption) {

        $this->db->get_where('mediamanager', array('caption' => $caption, 'username' => $username));    
        
        $sql = $this->db->get();

        $result = $sql->result();

        return $result;


    }

But no mather what I try, I get errors Sad

Can someone help me plz Smile

Thx!


Messages In This Thread
Can somebody help me please? - by El Forum - 06-24-2010, 08:15 AM
Can somebody help me please? - by El Forum - 06-24-2010, 08:24 AM
Can somebody help me please? - by El Forum - 06-24-2010, 08:34 AM
Can somebody help me please? - by El Forum - 06-24-2010, 09:29 AM
Can somebody help me please? - by El Forum - 06-24-2010, 10:04 AM
Can somebody help me please? - by El Forum - 06-24-2010, 10:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB