Welcome Guest, Not a member yet? Register   Sign In
Changing db results in model before passing
#11

[eluser]bretticus[/eluser]
So I just tested the following code:

model method:

Code:
function test() {
        return $this->db->get('videos')->result_array();
    }

controller method:

Code:
function test()
    {
        $this->load->model('the_model');

        var_dump($this->the_model->test());
    }

You're right on result_array() too. They must have some clever way to detect whether it's being iterated over and return a single row. Ya know, I've seen code like this over the last few years (I've been using CI for at least 2 years or more) and somehow it never occurred to me to try this. :red:

Thanks for enlightening me.
#12

[eluser]timotheus[/eluser]
Right back at you, thanks for your help as well!




Theme © iAndrew 2016 - Forum software by © MyBB