cvs: php4 /pear/DB sybase.php

From: Date: Tue, 09 Oct 2001 22:32:18 +0000
Subject: cvs: php4 /pear/DB sybase.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-965@lists.php.net to get a copy of this message
cox Tue Oct 9 18:32:18 2001 EDT Modified files: /php4/pear/DB sybase.php Log: Fix a problem with fetchInto (patch mostly from Steve_Joiner@focusppo.com) Index: php4/pear/DB/sybase.php diff -u php4/pear/DB/sybase.php:1.20 php4/pear/DB/sybase.php:1.21 --- php4/pear/DB/sybase.php:1.20 Tue Aug 7 07:45:23 2001 +++ php4/pear/DB/sybase.php Tue Oct 9 18:32:16 2001 @@ -16,7 +16,7 @@ // | Authors: Sterling Hughes <sterling@php.net> | // +----------------------------------------------------------------------+ // -// $Id: sybase.php,v 1.20 2001/08/07 11:45:23 cox Exp $ +// $Id: sybase.php,v 1.21 2001/10/09 22:32:16 cox Exp $ // // Database independent query interface definition for PHP's Sybase // extension. @@ -111,20 +111,16 @@ // }}} // {{{ fetchRow() - function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT) + function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null) { if ($fetchmode == DB_FETCHMODE_DEFAULT) { $fetchmode = $this->fetchmode; } - $row = ($fetchmode & DB_FETCHMODE_ASSOC) ? @sybase_fetch_array($result) : @sybase_fetch_row($result); - if (!$row) { - if ($errmsg = sybase_get_last_message()) { - return $this->raiseError($errmsg); - } else { - return null; - } + $res = $this->fetchInto ($result, $arr, $fetchmode, $rownum); + if ($res !== DB_OK) { + return $res; } - return $row; + return $arr; } // }}} @@ -137,16 +133,15 @@ return $this->raiseError(); } } - if ($fetchmode == DB_FETCHMODE_DEFAULT) { - $fetchmode = $this->fetchmode; - } $ar = ($fetchmode & DB_FETCHMODE_ASSOC) ? @sybase_fetch_array($result) : @sybase_fetch_row($result); if (!$ar) { - if ($errmsg = sybase_get_last_message()) { - return $this->raiseError($errmsg); - } else { + // reported not work as seems that sybase_get_last_message() + // always return a message here + //if ($errmsg = sybase_get_last_message()) { + // return $this->raiseError($errmsg); + //} else { return null; - } + //} } return DB_OK; }

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