Welcome Guest, Not a member yet? Register   Sign In
large query number of rows issue solution patch
#8

[eluser]Shiro[/eluser]
for the getNumberOfRows , only work for single table count, if my query join 2 or more table, the strstr function will break my SQL,

but these following code is better than above one +1 to this code.
[quote author="vijinho" date="1190728736"]the advantage of this code is that if you dont specify a table (because you set up your db query to query across several) you can still count the rows without pulling all of them back as is presently needed with active record.

e.g.this model class gets a list of fields to order in a certain way and can return the row count only for that query which is executed using active record:

Code:
function getUsersDetails($fields = array(), $orderby = null, $sortdir = null, $rowcountonly = null, $limit
= null, $offset = null)
    {
        $fields = join(',', $fields);
        $this->db->select($fields);
        .......

vijay[/quote]


Messages In This Thread
large query number of rows issue solution patch - by El Forum - 09-24-2007, 10:39 AM
large query number of rows issue solution patch - by El Forum - 09-24-2007, 11:54 PM
large query number of rows issue solution patch - by El Forum - 09-25-2007, 02:58 AM
large query number of rows issue solution patch - by El Forum - 09-25-2007, 05:25 AM
large query number of rows issue solution patch - by El Forum - 09-25-2007, 09:19 AM
large query number of rows issue solution patch - by El Forum - 09-25-2007, 04:58 PM
large query number of rows issue solution patch - by El Forum - 09-25-2007, 05:33 PM
large query number of rows issue solution patch - by El Forum - 12-30-2009, 08:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB