Welcome Guest, Not a member yet? Register   Sign In
Oracle driver and $this->db->count_all()
#1

[eluser]Unknown[/eluser]
Hi.

Not sure if this has been brought up anywhere, apologies if it has. Please feel free to move this post if its in the wrong place.

Issue encountered on : CI 1.7 on Apache/2.2.9 (Win32) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.6.

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: stdClass::$NUMROWS

Filename: oci8/oci8_driver.php

Line Number: 438

Error appears to be caused by $NUMROWS on line 438 (/system/database/oci8/oci8_driver.php) being capitalised. Please see the below fix. It is working thus far.

Before:

Code:
function count_all($table = '')
    {
        if ($table == '')
            return '0';

        $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE));

        if ($query == FALSE)
            {
            return 0;
            }

        $row = $query->row();
        return $row->NUMROWS;

After:
Code:
function count_all($table = '')
    {
        if ($table == '')
            return '0';

        $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE));

        if ($query == FALSE)
            {
            return 0;
            }

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

shoutout to the following posts : http://www.abbett.org/2007/12/02/using-o...deigniter/ and http://techxplorer.com/2008/11/03/using-...-database/

Thanks


Messages In This Thread
Oracle driver and $this->db->count_all() - by El Forum - 12-27-2008, 07:00 AM
Oracle driver and $this->db->count_all() - by El Forum - 12-29-2008, 04:56 PM
Oracle driver and $this->db->count_all() - by El Forum - 07-10-2009, 02:30 AM
Oracle driver and $this->db->count_all() - by El Forum - 02-27-2011, 09:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB