Part of the EllisLab Network

Bug Report

bug in query() in DB_driver.php for oci8

Date: 10/02/2008 Severity: Trivial
Status: Resolved Reporter: Kevin Q. Yu
Version: 1.6.3
Keywords: Libraries, Database Class

Description

Warning message when apply a query:
Message: ocifetchinto() expects parameter 1 to be resource, null given
Filename: oci8/oci8_result.php
Line Number: 159

Fix:
DB_driver.php (“Load and instantiate the result driver”):
move line
“$RES->num_rows   = $RES->num_rows();”
to the behind of oci8 process block.

Code Sample

// Load and instantiate the result driver

$driver         = $this->load_rdriver();
$RES            = new $driver();
$RES->conn_id   = $this->conn_id;
$RES->result_id = $this->result_id;
// it should be moved to behind of oci8 block
//$RES->num_rows    = $RES->num_rows();

if ($this->dbdriver == 'oci8')
{
    $RES
->stmt_id       = $this->stmt_id;
    
$RES->curs_id       = NULL;
    
$RES->limit_used    = $this->limit_used;
}
// should be moved here
$RES->num_rows  = $RES->num_rows();

Expected Result

give the query result without any warning information.

Actual Result

A PHP Error was encountered

Severity: Warning

Message: ocifetchinto() expects parameter 1 to be resource, null given

Filename: oci8/oci8_result.php

Line Number: 159

Comment on Bug Report

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?