Welcome Guest, Not a member yet? Register   Sign In
Small Oracle bug
#1

[eluser]Negligence[/eluser]
I'm not sure what's going on, but see below. This is the code I'm assuming (not using Active Record since it's broken, but the result would likely be the same):
Code:
$query = $this->db->query('SELECT FIELD FROM TABLE');
$result = $query->row_array();

This is the code in question:
Code:
function _fetch_assoc(&$row)
    {
        $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;
    
        return ocifetchinto($id, $row, OCI_ASSOC + OCI_RETURN_NULLS);
    }

The error:
Code:
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

The first parameter, $id, the statement ID, is somehow always NULL at first whenever it tries to retrieve results. If you print the $id variable, the first time it prints null, and every time after that it correctly prints the resource number.

In other words, for some reason whenever it tries to retrieve the first row of data from a query, it has a null resource. I didn't do a lot of exploring, but I couldn't determine where the culprit was.




Theme © iAndrew 2016 - Forum software by © MyBB