Php – PDO ODBC error just resets connection

apache-2.2cakephpodbcpdoPHP

Trying to write an ODBC PDO driver for CakePHP. Seems like I get closer and closer however whenever a PDO function is called that it doesn't like the connection just gets reset immediately and I'm not able to get any error information whatsoever. I'm thinking this could be a possible config setting but I can't find anything. I dunno if this will help but here is the particular snippet I'm working with:

public function fetchResult() {
    debug($this->_result);
    if ($row = $this->_result->fetch()) { // ### HERE IS WHERE IT RESETS ###
        debug($this->_connection->errorInfo());
        exit;
        $resultRow = array();
        foreach ($this->map as $col => $meta) {
            list($table, $column, $type) = $meta;
            if ($table === 0 && $column === self::ROW_COUNTER) {
                continue;
            }
            $resultRow[$table][$column] = $row[$col];
            if ($type === 'boolean' && !is_null($row[$col])) {
                $resultRow[$table][$column] = $this->boolean($resultRow[$table][$column]);
            }
        }
        return $resultRow;
    }
    $this->_result->closeCursor();
    return false;
}

The only difference between this method and the original CakePHP fetchResult function is that I'm not passing in the PDO::FETCH_NUM argument but either way still doesn't work!

Best Answer

There are deeper issues.

I'm certain this is a bug: https://bugs.php.net/bug.php?id=64483