Welcome Guest, Not a member yet? Register   Sign In
Can someone help me understand count_all_results?
#3

[eluser]BrianDHall[/eluser]
Code:
/**
     * "Count All Results" query
     *
     * Generates a platform-specific query string that counts all records
     * returned by an Active Record query.
     *
     * @access    public
     * @param    string
     * @return    string
     */
    function count_all_results($table = '')
    {
        if ($table != '')
        {
            $this->_track_aliases($table);
            $this->from($table);
        }
        
        $sql = $this->_compile_select($this->_count_string . $this->_protect_identifiers('numrows'));

        $query = $this->query($sql);
        $this->_reset_select();
    
        if ($query->num_rows() == 0)
        {
            return '0';
        }

        $row = $query->row();
        return $row->numrows;
    }

What does that mean? Beats the hell out of me. I thought it might help, but I don't immediately see the difference.


Messages In This Thread
Can someone help me understand count_all_results? - by El Forum - 09-22-2009, 10:59 AM
Can someone help me understand count_all_results? - by El Forum - 09-22-2009, 12:40 PM
Can someone help me understand count_all_results? - by El Forum - 09-22-2009, 12:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB