cvs: php4 /pear/DB odbc.php

From: Date: Fri, 05 Oct 2001 14:18:17 +0000
Subject: cvs: php4 /pear/DB odbc.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-933@lists.php.net to get a copy of this message
cox Fri Oct 5 10:18:17 2001 EDT Modified files: /php4/pear/DB odbc.php Log: version compat fix in fetchInto Index: php4/pear/DB/odbc.php diff -u php4/pear/DB/odbc.php:1.39 php4/pear/DB/odbc.php:1.40 --- php4/pear/DB/odbc.php:1.39 Mon Aug 20 22:46:29 2001 +++ php4/pear/DB/odbc.php Fri Oct 5 10:18:17 2001 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: odbc.php,v 1.39 2001/08/21 02:46:29 chagenbu Exp $ +// $Id: odbc.php,v 1.40 2001/10/05 14:18:17 cox Exp $ // // Database independent query interface definition for PHP's ODBC // extension. @@ -190,9 +190,20 @@ function fetchInto($result, &$row, $fetchmode, $rownum=null) { - $row = array(); - $rownum = ($rownum !== null) ? $rownum : $this->row[$result]; - $cols = odbc_fetch_into($result, $rownum, &$row); + if ($rownum !== null) { + if (PEAR::phpVersionIs('4.0.5')) { + $cols = odbc_fetch_into($result, $rownum, &$row); + } else { + $cols = odbc_fetch_into($result, $rownum, $row); + } + } else { + if (PEAR::phpVersionIs('4.0.5')) { + $cols = odbc_fetch_into($result, &$row); + } else { + $cols = odbc_fetch_into($result, $row); + } + } + if (!$cols) { /* XXX FIXME: doesn't work with unixODBC and easysoft (get corrupted $errno values) @@ -208,7 +219,6 @@ } $row = $a; } - $this->row[$result] = ++$rownum; return DB_OK; } @@ -302,7 +312,7 @@ $repeat = 0; } } while ($repeat); - + if (DB::isError($result)) { return $result; } @@ -311,12 +321,12 @@ if (DB::isError($result)) { return $result; } - + $row = $result->fetchRow(DB_FETCHMODE_ASSOC); if (DB::isError($row || !$row)) { return $row; } - + return $row['id']; }

« previous php.pear.cvs (#933) next »