Welcome Guest, Not a member yet? Register   Sign In
Acrive Record: Getting the row total then setting limit clause
#1

[eluser]EEssam[/eluser]
Hi,

My search model looks like the following:

Code:
function get()
    {
        if ($this->brandid)
        {
            $this->db->where('brandid', $this->brandid);
        }

        $this->db->select('*');

        $this->db->from('product');

        $this->row_count = $this->db->count_all_results();

        $this->db->limit($this->row_count, $this->offset);

        $query = $this->db->get();

        return $query;
    }

But it's not working. I need to set the limit clause because my search results are paginated.

Please help. Thanks.


Messages In This Thread
Acrive Record: Getting the row total then setting limit clause - by El Forum - 11-07-2008, 02:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB