Welcome Guest, Not a member yet? Register   Sign In
Active Record Class and free_result
#1

[eluser]scud[/eluser]
Hi,

I need to set free records in Active Record Class. I'm using CI on command line and application in a loop that never ending. So I need to close open database connetions and set queries free.

While I'm using Active Record Class How can I close it:

here is some codes need to close after running:

Code:
$this->db->select('*')
                ->from('accounts')
                ->where('status= 0')
                ->where("TIMESTAMPDIFF(DAY,last_invoice, NOW()) > 32")
                ->order_by('id', 'ASC');
        return $this->db->get()->result();

This query is running every 1 minute for 24 hours and bringing some results.


is it possible to run something like this:
Code:
$rst =  $this->db->get()->result();
$this->db->close()->result();
return $rst;




Theme © iAndrew 2016 - Forum software by © MyBB