cvs: pear /MDB2 MDB2.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php oci8.php pgsql.php querysim.php sqlite.php
/MDB2/MDB2/Driver/Manager fbsql.php mysql.php sqlite.php /MDB2/MDB2/Driver/Reverse mysql.php /MDB2/MDB2/Wrapper peardb.php /MDB2/docs
Driver_skeleton.php /MDB2/docs/examples example.php peardb_wrapper_example.php

From: Date: Thu, 29 Apr 2004 22:40:32 +0000
Subject: cvs: pear /MDB2 MDB2.php /MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php oci8.php pgsql.php querysim.php sqlite.php
/MDB2/MDB2/Driver/Manager fbsql.php mysql.php sqlite.php /MDB2/MDB2/Driver/Reverse mysql.php /MDB2/MDB2/Wrapper peardb.php /MDB2/docs
Driver_skeleton.php /MDB2/docs/examples example.php peardb_wrapper_example.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-18990@lists.php.net to get a copy of this message
lsmith Thu Apr 29 18:40:32 2004 EDT Modified files: /pear/MDB2 MDB2.php /pear/MDB2/docs Driver_skeleton.php /pear/MDB2/docs/examples example.php peardb_wrapper_example.php /pear/MDB2/MDB2/Driver fbsql.php ibase.php mssql.php mysql.php oci8.php pgsql.php querysim.php sqlite.php /pear/MDB2/MDB2/Driver/Manager fbsql.php mysql.php sqlite.php /pear/MDB2/MDB2/Driver/Reverse mysql.php /pear/MDB2/MDB2/Wrapper peardb.php Log: - added MDB2_FETCHMODE_OBJECT - added MDB2_Driver_Result_Common::getRowCounter() - explicitly specify colum name in sequence emulation queries

http://cvs.php.net/diff.php/pear/MDB2/MDB2.php?r1=1.26&r2=1.27&ty=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.26 pear/MDB2/MDB2.php:1.27 --- pear/MDB2/MDB2.php:1.26 Thu Apr 29 16:19:09 2004 +++ pear/MDB2/MDB2.php Thu Apr 29 18:40:31 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.26 2004/04/29 20:19:09 lsmith Exp $ +// $Id: MDB2.php,v 1.27 2004/04/29 22:40:31 lsmith Exp $ // /** @@ -123,6 +123,11 @@ define('MDB2_FETCHMODE_ASSOC', 2); /** + * Column data as object properties + */ +define('MDB2_FETCHMODE_OBJECT', 3); + +/** * For multi-dimensional results: normally the first level of arrays * is the row number, and the second level indexed by column number or name. * MDB2_FETCHMODE_FLIPPED switches this order, so the first level of arrays @@ -831,6 +836,7 @@ * $options['buffered_result_class'] -> class used for buffered result sets * $options['result_wrap_class'] -> class used to wrap result sets into * $options['result_buffering'] -> boolean should results be buffered or not? + * $options['fetch_class'] -> class to use when fetch mode object is used * $options['persistent'] -> boolean persistent connection? * $options['debug'] -> integer numeric debug level * $options['debug_handler'] -> string function/meothd that captures debug messages @@ -849,6 +855,7 @@ 'buffered_result_class' => 'MDB2_BufferedResult_%s', 'result_wrap_class' => false, 'result_buffering' => true, + 'fetch_class' => 'stdClass', 'persistent' => false, 'debug' => 0, 'debug_handler' => 'MDB2_defaultDebugOutput', @@ -1128,18 +1135,29 @@ /** * Sets which fetch mode should be used by default on queries - * on this connection. + * on this connection + * + * @param integer $fetchmode MDB2_FETCHMODE_ORDERED or + * MDB2_FETCHMODE_ASSOC, possibly bit-wise OR'ed with + * MDB2_FETCHMODE_FLIPPED. + * + * @param string $object_class The class of the object + * to be returned by the fetch methods when + * the MDB2_FETCHMODE_OBJECT mode is selected. + * If no class is specified by default a cast + * to object from the assoc array row will be done. * - * @param integer $fetchmode MDB2_FETCHMODE_ORDERED or MDB2_FETCHMODE_ASSOC, - * possibly bit-wise OR'ed with MDB2_FETCHMODE_FLIPPED. - * @access public * @see MDB2_FETCHMODE_ORDERED * @see MDB2_FETCHMODE_ASSOC * @see MDB2_FETCHMODE_FLIPPED + * @see MDB2_FETCHMODE_OBJECT + * @access public */ - function setFetchMode($fetchmode) + function setFetchMode($fetchmode, $object_class = 'stdClass') { switch ($fetchmode) { + case MDB2_FETCHMODE_OBJECT: + $this->objects['fetch_class'] = $object_class; case MDB2_FETCHMODE_ORDERED: case MDB2_FETCHMODE_ASSOC: $this->fetchmode = $fetchmode; @@ -2497,6 +2515,9 @@ var $result; var $rownum = -1; var $types; + var $offset; + var $offset_count = 0; + var $limit; // }}} // {{{ constructor @@ -2504,10 +2525,12 @@ /** * Constructor */ - function MDB2_Result_Common(&$mdb, &$result) + function MDB2_Result_Common(&$mdb, &$result, $offset, $limit) { $this->mdb =& $mdb; $this->result =& $result; + $this->offset = $offset; + $this->limit = $limit - 1; } // }}} @@ -2591,7 +2614,7 @@ * @return mixed data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { $columns = $this->numCols(); if (MDB2::isError($columns)) { @@ -2601,6 +2624,10 @@ if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if ($fetchmode & MDB2_FETCHMODE_ASSOC) { $column_names = $this->getColumnNames(); if (MDB2::isError($column_names)) { @@ -2635,6 +2662,13 @@ $row = array_change_key_case($row, CASE_LOWER); } } + if (isset($object_class)) { + if ($object_class == 'stdClass') { + $row = (object) $row; + } else { + $row = &new $object_class($row); + } + } return $row; } @@ -2691,7 +2725,7 @@ $force_array = false, $group = false) { $all = array(); - while (is_array($row = $this->fetchRow($fetchmode))) { + while (!MDB2::isError($row = $this->fetchRow($fetchmode)) && $row) { if ($rekey && count($row) < 2) { return $this->mdb->raiseError(MDB2_ERROR_TRUNCATED); } @@ -2699,6 +2733,10 @@ if ($fetchmode & MDB2_FETCHMODE_ASSOC) { $key = reset($row); unset($row[key($row)]); + } elseif ($fetchmode & MDB2_FETCHMODE_OBJECT) { + $arr = get_object_vars($row); + $key = reset($arr); + unset($arr->{key($row)}); } else { $key = array_shift($row); } @@ -2728,6 +2766,18 @@ } // }}} + // {{{ getRowCounter() + + /** + * returns the actual row number that was last fetched (count from 0) + * @return integer + */ + function getRowCounter() + { + return $this->rownum + $this->offset; + } + + // }}} // {{{ nextResult() /** http://cvs.php.net/diff.php/pear/MDB2/docs/Driver_skeleton.php?r1=1.6&r2=1.7&ty=u Index: pear/MDB2/docs/Driver_skeleton.php diff -u pear/MDB2/docs/Driver_skeleton.php:1.6 pear/MDB2/docs/Driver_skeleton.php:1.7 --- pear/MDB2/docs/Driver_skeleton.php:1.6 Fri Apr 9 14:24:56 2004 +++ pear/MDB2/docs/Driver_skeleton.php Thu Apr 29 18:40:31 2004 @@ -42,7 +42,7 @@ // | Author: YOUR NAME <YOUR EMAIL> | // +----------------------------------------------------------------------+ // -// $Id: Driver_skeleton.php,v 1.6 2004/04/09 18:24:56 lsmith Exp $ +// $Id: Driver_skeleton.php,v 1.7 2004/04/29 22:40:31 lsmith Exp $ // // This is just a skeleton MDB2 driver. @@ -388,7 +388,7 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { // take this from the corresponding Metabase driver: FetchResultArray() // possibly you also need to take code from Metabases FetchRow() method http://cvs.php.net/diff.php/pear/MDB2/docs/examples/example.php?r1=1.6&r2=1.7&ty=u Index: pear/MDB2/docs/examples/example.php diff -u pear/MDB2/docs/examples/example.php:1.6 pear/MDB2/docs/examples/example.php:1.7 --- pear/MDB2/docs/examples/example.php:1.6 Fri Apr 9 06:42:36 2004 +++ pear/MDB2/docs/examples/example.php Thu Apr 29 18:40:31 2004 @@ -1,6 +1,6 @@ <?php - // $Id: example.php,v 1.6 2004/04/09 10:42:36 lsmith Exp $ + // $Id: example.php,v 1.7 2004/04/29 22:40:31 lsmith Exp $ // // MDB2 test script. // @@ -90,6 +90,12 @@ $result->free(); echo('<br>row:<br>'); echo(Var_Dump::display($array).'<br>'); + $result = $db->query($query); + // lets just get row:0 and free the result + $array = $result->fetchRow(MDB2_FETCHMODE_OBJECT); + $result->free(); + echo('<br>row (object:<br>'); + echo(Var_Dump::display($array).'<br>'); // run the query and get a result handler $result = $db->query($query); // lets just get row:0 and free the result http://cvs.php.net/diff.php/pear/MDB2/docs/examples/peardb_wrapper_example.php?r1=1.2&r2=1.3&ty=u Index: pear/MDB2/docs/examples/peardb_wrapper_example.php diff -u pear/MDB2/docs/examples/peardb_wrapper_example.php:1.2 pear/MDB2/docs/examples/peardb_wrapper_example.php:1.3 --- pear/MDB2/docs/examples/peardb_wrapper_example.php:1.2 Sun Apr 25 06:05:30 2004 +++ pear/MDB2/docs/examples/peardb_wrapper_example.php Thu Apr 29 18:40:31 2004 @@ -1,5 +1,5 @@ <?php -// $Id: peardb_wrapper_example.php,v 1.2 2004/04/25 10:05:30 lsmith Exp $ +// $Id: peardb_wrapper_example.php,v 1.3 2004/04/29 22:40:31 lsmith Exp $ // // MDB2 test script for the PEAR DB Wrapper. // @@ -74,11 +74,11 @@ // lets create a sequence on demand echo('<br>get the next id using on demand:<br>'); - echo('<br>nextId:'.$db->nextId('real_funky_id_2')); + echo('<br>nextId:'.$db->nextId('real_funky_id_wrapper_2')); echo('<br>dropSequence:'.$db->dropSequence('real_funky_id_2')); echo('<br>get the next id:<br>'); - echo($db->nextId('real_funky_id').'<br>'); + echo($db->nextId('real_funky_id_wrapper').'<br>'); // lets try an prepare execute combo $alldata = array( array(1, 'one', 'un'), http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/fbsql.php?r1=1.12&r2=1.13&ty=u Index: pear/MDB2/MDB2/Driver/fbsql.php diff -u pear/MDB2/MDB2/Driver/fbsql.php:1.12 pear/MDB2/MDB2/Driver/fbsql.php:1.13 --- pear/MDB2/MDB2/Driver/fbsql.php:1.12 Thu Apr 29 16:14:16 2004 +++ pear/MDB2/MDB2/Driver/fbsql.php Thu Apr 29 18:40:31 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.12 2004/04/29 20:14:16 lsmith Exp $ +// $Id: fbsql.php,v 1.13 2004/04/29 22:40:31 lsmith Exp $ // /** @@ -396,7 +396,7 @@ ? $this->options['buffered_result_class'] : $this->options['result_class']; } $class_name = sprintf($result_class, $this->phptype); - $result =& new $class_name($this, $result); + $result =& new $class_name($this, $result, $offset, $limit); if ($types) { $err = $result->setResultTypes($types); if (MDB2::isError($err)) { @@ -457,7 +457,7 @@ { $sequence_name = $this->getSequenceName($seq_name); $this->expectError(MDB2_ERROR_NOSUCHTABLE); - $result = $this->query("INSERT INTO $sequence_name VALUES (NULL)"); + $result = $this->query("INSERT INTO $sequence_name (".$this->options['seqname_col_name'].") VALUES (NULL)"); $this->popExpect(); if (MDB2::isError($result)) { if ($ondemand && $result->getCode() == MDB2_ERROR_NOSUCHTABLE) { @@ -504,7 +504,7 @@ } -class MDB2_Result_mysql extends MDB2_Result_Common +class MDB2_Result_fbsql extends MDB2_Result_Common { // }}} // {{{ constructor @@ -512,9 +512,9 @@ /** * Constructor */ - function MDB2_Result_mysql(&$mdb, &$result) + function MDB2_Result_fbsql(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_Common($mdb, $result); + parent::MDB2_Result_Common($mdb, $result, $offset, $limit); } // }}} @@ -561,11 +561,15 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if ($fetchmode & MDB2_FETCHMODE_ASSOC) { $row = @fbsql_fetch_assoc($this->result); if ($this->mdb->options['portability'] & MDB2_PORTABILITY_LOWERCASE @@ -589,6 +593,13 @@ if ($this->mdb->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL) { $this->mdb->_convertEmptyArrayValuesToNull($row); } + if (isset($object_class)) { + if ($object_class == 'stdClass') { + $row = (object) $row; + } else { + $row = &new $object_class($row); + } + } ++$this->rownum; return $row; } @@ -693,7 +704,7 @@ } } -class MDB2_BufferedResult_mysql extends MDB2_Result_mysql +class MDB2_BufferedResult_fbsql extends MDB2_Result_fbsql { // }}} // {{{ constructor @@ -701,9 +712,9 @@ /** * Constructor */ - function MDB2_BufferedResult_mysql(&$mdb, &$result) + function MDB2_BufferedResult_mysql(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_mysql($mdb, $result); + parent::MDB2_Result_mysql($mdb, $result, $offset, $limit); } // }}} http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/ibase.php?r1=1.24&r2=1.25&ty=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.24 pear/MDB2/MDB2/Driver/ibase.php:1.25 --- pear/MDB2/MDB2/Driver/ibase.php:1.24 Thu Apr 29 16:14:16 2004 +++ pear/MDB2/MDB2/Driver/ibase.php Thu Apr 29 18:40:31 2004 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.24 2004/04/29 20:14:16 lsmith Exp $ +// $Id: ibase.php,v 1.25 2004/04/29 22:40:31 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -625,8 +625,6 @@ class MDB2_Result_ibase extends MDB2_Result_Common { - var $limits; - // }}} // {{{ constructor @@ -635,14 +633,7 @@ */ function MDB2_Result_ibase(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_Common($mdb, $result); - if ($offset || $limit) { - $this->limits = array( - 'offset' => $offset, - 'count' => 0, - 'limit' => ($limit - 1), - ); - } + parent::MDB2_Result_Common($mdb, $result, $offset, $limit); } // }}} @@ -657,14 +648,16 @@ */ function _skipLimitOffset() { - if (isset($this->limits) && is_array($this->limits)) { - if ($this->rownum > $this->limits['limit']) { + if ($this->limit)) { + if ($this->rownum > $this->limit) { return false; } - while ($this->limits['count'] < $this->limits['offset']) { - ++$this->limits['count']; + } + if ($this->offset)) { + while ($this->offset_count < $this->offset) { + ++$this->offset_count; if (!is_array(@ibase_fetch_row($this->result))) { - $this->limits['count'] = $this->limits['offset']; + $this->offset_count = $this->offset; return false; } } @@ -710,7 +703,7 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { /* if ($this->result === true) { @@ -722,6 +715,10 @@ if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if (!$this->_skipLimitOffset()) { return null; } @@ -751,6 +748,13 @@ if ($this->mdb->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL) { $this->mdb->_convertEmptyArrayValuesToNull($row); } + if (isset($object_class)) { + if ($object_class == 'stdClass') { + $row = (object) $row; + } else { + $row = &new $object_class($row); + } + } ++$this->rownum; return $row; } @@ -888,7 +892,7 @@ $buffer = true; while ((is_null($rownum) || $this->buffer_rownum < $rownum) - && (!isset($this->limits) || $this->buffer_rownum < $this->limits['limit']) + && (!$this->limit || $this->buffer_rownum < $this->limit) && ($buffer = @ibase_fetch_row($this->result)) ) { ++$this->buffer_rownum; @@ -899,7 +903,7 @@ ++$this->buffer_rownum; $this->buffer[$this->buffer_rownum] = false; return false; - } elseif (isset($this->limits) && $this->buffer_rownum >= $this->limits['limit']) { + } elseif ($this->limit && $this->buffer_rownum >= $this->limit) { ++$this->buffer_rownum; $this->buffer[$this->buffer_rownum] = false; } @@ -916,7 +920,7 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { if (is_null($this->result)) { return $this->mdb->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, @@ -926,6 +930,10 @@ if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if (!$this->_fillBuffer($target_rownum)) { return null; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mssql.php?r1=1.13&r2=1.14&ty=u Index: pear/MDB2/MDB2/Driver/mssql.php diff -u pear/MDB2/MDB2/Driver/mssql.php:1.13 pear/MDB2/MDB2/Driver/mssql.php:1.14 --- pear/MDB2/MDB2/Driver/mssql.php:1.13 Thu Apr 29 16:14:16 2004 +++ pear/MDB2/MDB2/Driver/mssql.php Thu Apr 29 18:40:31 2004 @@ -43,7 +43,7 @@ // | Author: Frank M. Kromann <frank@kromann.info> | // +----------------------------------------------------------------------+ // -// $Id: mssql.php,v 1.13 2004/04/29 20:14:16 lsmith Exp $ +// $Id: mssql.php,v 1.14 2004/04/29 22:40:31 lsmith Exp $ // /** @@ -513,8 +513,6 @@ class MDB2_Result_mssql extends MDB2_Result_Common { - var $limits; - // }}} // {{{ constructor @@ -523,14 +521,7 @@ */ function MDB2_Result_mssql(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_Common($mdb, $result); - if ($offset || $limit) { - $this->limits = array( - 'offset' => $offset, - 'limit' => $limit, - 'count' => 0 - ); - } + parent::MDB2_Result_Common($mdb, $result, $offset, $limit); } // }}} @@ -545,14 +536,16 @@ */ function _skipLimitOffset() { - if (isset($this->limits) && is_array($this->limits)) { - if ($this->rownum >= $this->limits['limit']) { + if ($this->limit) { + if ($this->rownum >= $this->limit) { return MDB2_ERROR; } - while ($this->limits['count'] < $this->limits['offset']) { - $this->limits['count']++; + } + if ($this->offset) { + while ($this->offset_count < $this->offset) { + ++$this->offset_count; if (!is_array(@mysql_fetch_row($this->result))) { - $this->limits['count'] = $this->limits['offset']; + $this->offset_count = $this->limit; return MDB2_ERROR; } } @@ -604,11 +597,15 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if (!$this->_skipLimitOffset()) { return null; } @@ -635,6 +632,13 @@ if ($this->mdb->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL) { $this->mdb->_convertEmptyArrayValuesToNull($row); } + if (isset($object_class)) { + if ($object_class == 'stdClass') { + $row = (object) $row; + } else { + $row = &new $object_class($row); + } + } ++$this->rownum; return $row; } @@ -786,8 +790,8 @@ } return $this->raiseError(); } - if (isset($this->limits)) { - $rows -= $this->limits[0]; + if ($this->limit) { + $rows -= $this->limit; if ($rows < 0) { $rows = 0; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/mysql.php?r1=1.14&r2=1.15&ty=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.14 pear/MDB2/MDB2/Driver/mysql.php:1.15 --- pear/MDB2/MDB2/Driver/mysql.php:1.14 Thu Apr 29 16:14:16 2004 +++ pear/MDB2/MDB2/Driver/mysql.php Thu Apr 29 18:40:31 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.14 2004/04/29 20:14:16 lsmith Exp $ +// $Id: mysql.php,v 1.15 2004/04/29 22:40:31 lsmith Exp $ // /** @@ -482,7 +482,7 @@ ? $this->options['buffered_result_class'] : $this->options['result_class']; } $class_name = sprintf($result_class, $this->phptype); - $result =& new $class_name($this, $result); + $result =& new $class_name($this, $result, $offset, $limit); if ($types) { $err = $result->setResultTypes($types); if (MDB2::isError($err)) { @@ -674,7 +674,7 @@ { $sequence_name = $this->getSequenceName($seq_name); $this->expectError(MDB2_ERROR_NOSUCHTABLE); - $result =& $this->query("INSERT INTO $sequence_name VALUES (NULL)"); + $result =& $this->query("INSERT INTO $sequence_name (".$this->options['seqname_col_name'].") VALUES (NULL)"); $this->popExpect(); if (MDB2::isError($result)) { if ($ondemand && $result->getCode() == MDB2_ERROR_NOSUCHTABLE) { @@ -727,9 +727,9 @@ /** * Constructor */ - function MDB2_Result_mysql(&$mdb, &$result) + function MDB2_Result_mysql(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_Common($mdb, $result); + parent::MDB2_Result_Common($mdb, $result, $offset, $limit); } // }}} @@ -776,11 +776,15 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if ($fetchmode & MDB2_FETCHMODE_ASSOC) { $row = @mysql_fetch_assoc($this->result); if (is_array($row) @@ -804,6 +808,13 @@ if ($this->mdb->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL) { $this->mdb->_convertEmptyArrayValuesToNull($row); } + if (isset($object_class)) { + if ($object_class == 'stdClass') { + $row = (object) $row; + } else { + $row = &new $object_class($row); + } + } ++$this->rownum; return $row; } @@ -897,9 +908,9 @@ /** * Constructor */ - function MDB2_BufferedResult_mysql(&$mdb, &$result) + function MDB2_BufferedResult_mysql(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_mysql($mdb, $result); + parent::MDB2_Result_mysql($mdb, $result, $offset, $limit); } // }}} http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.11&r2=1.12&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.11 pear/MDB2/MDB2/Driver/oci8.php:1.12 --- pear/MDB2/MDB2/Driver/oci8.php:1.11 Fri Apr 23 13:06:46 2004 +++ pear/MDB2/MDB2/Driver/oci8.php Thu Apr 29 18:40:31 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.11 2004/04/23 17:06:46 lsmith Exp $ +// $Id: oci8.php,v 1.12 2004/04/29 22:40:31 lsmith Exp $ /** * MDB2 OCI8 driver @@ -695,8 +695,6 @@ class MDB2_Result_oci8 extends MDB2_Result_Common { - var $limits; - // }}} // {{{ constructor @@ -705,14 +703,7 @@ */ function MDB2_Result_oci8(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_Common($mdb, $result); - if ($offset || $limit) { - $this->limits = array( - 'offset' => $offset, - 'count' => 0, - 'limit' => ($limit - 1), - ); - } + parent::MDB2_Result_Common($mdb, $result, $offset, $limit); } // }}} @@ -727,12 +718,14 @@ */ function _skipLimitOffset() { - if (isset($this->limits) && is_array($this->limits)) { - if ($this->rownum > $this->limits['limit']) { + if ($this->limit) { + if ($this->rownum > $this->limit) { return false; } - while ($this->limits['count'] < $this->limits['offset']) { - ++$this->limits['count']; + } + if ($this->limit) { + while ($this->offset_count < $this->limit) { + ++$this->offset_count; if (!@OCIFetchInto($this->result, $row, OCI_RETURN_NULLS)) { return false; } @@ -779,11 +772,15 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if (!$this->_skipLimitOffset()) { return null; } @@ -810,6 +807,13 @@ if ($this->mdb->options['portability'] & MDB2_PORTABILITY_RTRIM) { $this->mdb->_rtrimArrayValues($row); } + if (isset($object_class)) { + if ($object_class == 'stdClass') { + $row = (object) $row; + } else { + $row = &new $object_class($row); + } + } ++$this->rownum; return $row; } @@ -936,7 +940,7 @@ $row = true; while ((is_null($rownum) || $this->buffer_rownum < $rownum) - && (!isset($this->limits) || $this->buffer_rownum < $this->limits['limit']) + && (!$this->limit || $this->buffer_rownum < $this->limit) && ($row = @OCIFetchInto($this->result, $buffer, OCI_RETURN_NULLS)) ) { ++$this->buffer_rownum; @@ -947,7 +951,7 @@ ++$this->buffer_rownum; $this->buffer[$this->buffer_rownum] = false; return false; - } elseif (isset($this->limits) && $this->buffer_rownum >= $this->limits['limit']) { + } elseif ($this->limit && $this->buffer_rownum >= $this->limit) { ++$this->buffer_rownum; $this->buffer[$this->buffer_rownum] = false; } @@ -964,7 +968,7 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { if (is_null($this->result)) { return $this->mdb->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, @@ -974,6 +978,10 @@ if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if (!$this->_fillBuffer($target_rownum)) { return null; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.13&r2=1.14&ty=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.13 pear/MDB2/MDB2/Driver/pgsql.php:1.14 --- pear/MDB2/MDB2/Driver/pgsql.php:1.13 Fri Apr 23 13:06:46 2004 +++ pear/MDB2/MDB2/Driver/pgsql.php Thu Apr 29 18:40:31 2004 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.13 2004/04/23 17:06:46 lsmith Exp $ +// $Id: pgsql.php,v 1.14 2004/04/29 22:40:31 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -490,7 +490,7 @@ ? $this->options['buffered_result_class'] : $this->options['result_class']; } $class_name = sprintf($result_class, $this->phptype); - $result =& new $class_name($this, $result); + $result =& new $class_name($this, $result, $offset, $limit); if ($types) { $err = $result->setResultTypes($types); if (MDB2::isError($err)) { @@ -571,9 +571,9 @@ /** * Constructor */ - function MDB2_Result_pgsql(&$mdb, &$result) + function MDB2_Result_pgsql(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_Common($mdb, $result); + parent::MDB2_Result_Common($mdb, $result, $offset, $limit); } // }}} @@ -620,11 +620,15 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if ($fetchmode & MDB2_FETCHMODE_ASSOC) { $row = @pg_fetch_array($this->result, null, PGSQL_ASSOC); if (is_array($row) @@ -648,6 +652,13 @@ if ($this->mdb->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL) { $this->mdb->_convertEmptyArrayValuesToNull($row); } + if (isset($object_class)) { + if ($object_class == 'stdClass') { + $row = (object) $row; + } else { + $row = &new $object_class($row); + } + } ++$this->rownum; return $row; } @@ -768,9 +779,9 @@ /** * Constructor */ - function MDB2_BufferedResult_pgsql(&$mdb, &$result) + function MDB2_BufferedResult_pgsql(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_pgsql($mdb, $result); + parent::MDB2_Result_pgsql($mdb, $result, $offset, $limit); } // }}} http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/querysim.php?r1=1.9&r2=1.10&ty=u Index: pear/MDB2/MDB2/Driver/querysim.php diff -u pear/MDB2/MDB2/Driver/querysim.php:1.9 pear/MDB2/MDB2/Driver/querysim.php:1.10 --- pear/MDB2/MDB2/Driver/querysim.php:1.9 Fri Apr 23 13:06:46 2004 +++ pear/MDB2/MDB2/Driver/querysim.php Thu Apr 29 18:40:31 2004 @@ -61,7 +61,7 @@ // | please contact Alan Richmond. | // +----------------------------------------------------------------------+ // -// $Id: querysim.php,v 1.9 2004/04/23 17:06:46 lsmith Exp $ +// $Id: querysim.php,v 1.10 2004/04/29 22:40:31 lsmith Exp $ // /* @@ -371,7 +371,7 @@ ? $this->options['buffered_result_class'] : $this->options['result_class']; } $class_name = sprintf($result_class, $this->phptype); - $result =& new $class_name($this, $result); + $result =& new $class_name($this, $result, $offset, $limit); if ($types) { $err = $result->setResultTypes($types); if (MDB2::isError($err)) { @@ -537,9 +537,9 @@ /** * Constructor */ - function MDB2_Result_querysim(&$mdb, &$result) + function MDB2_Result_querysim(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_Common($mdb, $result); + parent::MDB2_Result_Common($mdb, $result, $offset, $limit); } // }}} @@ -587,7 +587,7 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { if (is_null($this->result)) { return $this->mdb->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, @@ -597,6 +597,10 @@ if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if (!isset($this->result[1][$target_rownum])) { return null; } @@ -618,6 +622,13 @@ if ($this->mdb->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL) { $this->mdb->_convertEmptyArrayValuesToNull($row); } + if (isset($object_class)) { + if ($object_class == 'stdClass') { + $row = (object) $row; + } else { + $row = &new $object_class($row); + } + } ++$this->rownum; return $row; } @@ -682,9 +693,9 @@ /** * Constructor */ - function MDB2_BufferedResult_querysim(&$mdb, &$result) + function MDB2_BufferedResult_querysim(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_querysim($mdb, $result); + parent::MDB2_Result_querysim($mdb, $result, $offset, $limit); } // }}} http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/sqlite.php?r1=1.16&r2=1.17&ty=u Index: pear/MDB2/MDB2/Driver/sqlite.php diff -u pear/MDB2/MDB2/Driver/sqlite.php:1.16 pear/MDB2/MDB2/Driver/sqlite.php:1.17 --- pear/MDB2/MDB2/Driver/sqlite.php:1.16 Thu Apr 29 16:14:16 2004 +++ pear/MDB2/MDB2/Driver/sqlite.php Thu Apr 29 18:40:31 2004 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.16 2004/04/29 20:14:16 lsmith Exp $ +// $Id: sqlite.php,v 1.17 2004/04/29 22:40:31 lsmith Exp $ // /** @@ -454,7 +454,7 @@ ? $this->options['buffered_result_class'] : $this->options['result_class']; } $class_name = sprintf($result_class, $this->phptype); - $result =& new $class_name($this, $result); + $result =& new $class_name($this, $result, $offset, $limit); if ($types) { $err = $result->setResultTypes($types); if (MDB2::isError($err)) { @@ -616,7 +616,7 @@ { $sequence_name = $this->getSequenceName($seq_name); $this->expectError(MDB2_ERROR_NOSUCHTABLE); - $result = $this->query("INSERT INTO $sequence_name VALUES (NULL)"); + $result = $this->query("INSERT INTO $sequence_name (".$this->options['seqname_col_name'].") VALUES (NULL)"); $this->popExpect(); if (MDB2::isError($result)) { if ($ondemand && $result->getCode() == MDB2_ERROR_NOSUCHTABLE) { @@ -669,9 +669,9 @@ /** * Constructor */ - function MDB2_Result_mysql(&$mdb, &$result) + function MDB2_Result_sqlite(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_Common($mdb, $result); + parent::MDB2_Result_Common($mdb, $result, $offset, $limit); } // }}} @@ -712,11 +712,15 @@ * @return int data array on success, a MDB2 error on failure * @access public */ - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT) { if ($fetchmode == MDB2_FETCHMODE_DEFAULT) { $fetchmode = $this->mdb->fetchmode; } + if ($fetchmode === MDB2_FETCHMODE_OBJECT) { + $fetchmode = MDB2_FETCHMODE_ASSOC; + $object_class = $this->mdb->options['fetch_class']; + } if ($fetchmode & MDB2_FETCHMODE_ASSOC) { $row = @sqlite_fetch_array($this->result, SQLITE_ASSOC); if (is_array($row) @@ -740,6 +744,13 @@ if ($this->mdb->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL) { $this->mdb->_convertEmptyArrayValuesToNull($row); } + if (isset($object_class)) { + if ($object_class == 'stdClass') { + $row = (object) $row; + } else { + $row = &new $object_class($row); + } + } ++$this->rownum; return $row; } @@ -811,9 +822,9 @@ /** * Constructor */ - function MDB2_BufferedResult_sqlite(&$mdb, &$result) + function MDB2_BufferedResult_sqlite(&$mdb, &$result, $offset, $limit) { - parent::MDB2_Result_sqlite($mdb, $result); + parent::MDB2_Result_sqlite($mdb, $result, $offset, $limit); } // }}} http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/fbsql.php?r1=1.6&r2=1.7&ty=u Index: pear/MDB2/MDB2/Driver/Manager/fbsql.php diff -u pear/MDB2/MDB2/Driver/Manager/fbsql.php:1.6 pear/MDB2/MDB2/Driver/Manager/fbsql.php:1.7 --- pear/MDB2/MDB2/Driver/Manager/fbsql.php:1.6 Fri Apr 9 06:41:21 2004 +++ pear/MDB2/MDB2/Driver/Manager/fbsql.php Thu Apr 29 18:40:31 2004 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: fbsql.php,v 1.6 2004/04/09 10:41:21 lsmith Exp $ +// $Id: fbsql.php,v 1.7 2004/04/29 22:40:31 lsmith Exp $ // require_once 'MDB2/Driver/Manager/Common.php'; @@ -570,7 +570,7 @@ if ($start == 1) { return MDB2_OK; } - $res = $db->query("INSERT INTO $sequence_name VALUES (".($start-1).')'); + $res = $db->query("INSERT INTO $sequence_name ($seqname_col_name) VALUES (".($start-1).')'); if (!MDB2::isError($res)) { return MDB2_OK; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/mysql.php?r1=1.7&r2=1.8&ty=u Index: pear/MDB2/MDB2/Driver/Manager/mysql.php diff -u pear/MDB2/MDB2/Driver/Manager/mysql.php:1.7 pear/MDB2/MDB2/Driver/Manager/mysql.php:1.8 --- pear/MDB2/MDB2/Driver/Manager/mysql.php:1.7 Fri Apr 23 07:49:32 2004 +++ pear/MDB2/MDB2/Driver/Manager/mysql.php Thu Apr 29 18:40:31 2004 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.7 2004/04/23 11:49:32 lsmith Exp $ +// $Id: mysql.php,v 1.8 2004/04/29 22:40:31 lsmith Exp $ // require_once 'MDB2/Driver/Manager/Common.php'; @@ -639,14 +639,15 @@ } $res = $db->query("CREATE TABLE $sequence_name". "($seqname_col_name INT NOT NULL AUTO_INCREMENT, PRIMARY KEY ($seqname_col_name))". - (strlen($db->options['default_table_type']) ? ' TYPE='.$db->options['default_table_type'] : '')); + (strlen($db->options['default_table_type']) ? ' TYPE='.$db->options['default_table_type'] : '') + ); if (MDB2::isError($res)) { return $res; } if ($start == 1) { return MDB2_OK; } - $res = $db->query("INSERT INTO $sequence_name VALUES (".($start-1).')'); + $res = $db->query("INSERT INTO $sequence_name ($seqname_col_name) VALUES (".($start-1).')'); if (!MDB2::isError($res)) { return MDB2_OK; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/sqlite.php?r1=1.5&r2=1.6&ty=u Index: pear/MDB2/MDB2/Driver/Manager/sqlite.php diff -u pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.5 pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.6 --- pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.5 Wed Apr 7 17:15:31 2004 +++ pear/MDB2/MDB2/Driver/Manager/sqlite.php Thu Apr 29 18:40:31 2004 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: sqlite.php,v 1.5 2004/04/07 21:15:31 lsmith Exp $ +// $Id: sqlite.php,v 1.6 2004/04/29 22:40:31 lsmith Exp $ // require_once 'MDB2/Driver/Manager/Common.php'; @@ -434,7 +434,7 @@ if ($start == 1) { return MDB2_OK; } - $res = $db->query("INSERT INTO $sequence_name VALUES (".($start-1).')'); + $res = $db->query("INSERT INTO $sequence_name ($seqname_col_name) VALUES (".($start-1).')'); if (!MDB2::isError($res)) { return MDB2_OK; } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Reverse/mysql.php?r1=1.10&r2=1.11&ty=u Index: pear/MDB2/MDB2/Driver/Reverse/mysql.php diff -u pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.10 pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.11 --- pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.10 Sat Apr 10 06:46:53 2004 +++ pear/MDB2/MDB2/Driver/Reverse/mysql.php Thu Apr 29 18:40:31 2004 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.10 2004/04/10 10:46:53 lsmith Exp $ +// $Id: mysql.php,v 1.11 2004/04/29 22:40:31 lsmith Exp $ // require_once 'MDB2/Driver/Reverse/Common.php'; @@ -104,7 +104,7 @@ } $field_column = $columns['field']; $type_column = $columns['type']; - while (is_array($row = $result->fetchRow())) { + while (is_array($row = $result->fetchRow(MDB2_FETCHMODE_ORDERED))) { if ($field_name == $row[$field_column]) { $db_type = strtolower($row[$type_column]); $db_type = strtok($db_type, '(), '); http://cvs.php.net/diff.php/pear/MDB2/MDB2/Wrapper/peardb.php?r1=1.7&r2=1.8&ty=u Index: pear/MDB2/MDB2/Wrapper/peardb.php diff -u pear/MDB2/MDB2/Wrapper/peardb.php:1.7 pear/MDB2/MDB2/Wrapper/peardb.php:1.8 --- pear/MDB2/MDB2/Wrapper/peardb.php:1.7 Thu Apr 29 16:20:37 2004 +++ pear/MDB2/MDB2/Wrapper/peardb.php Thu Apr 29 18:40:31 2004 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: peardb.php,v 1.7 2004/04/29 20:20:37 lsmith Exp $ +// $Id: peardb.php,v 1.8 2004/04/29 22:40:31 lsmith Exp $ // /** @@ -106,7 +106,7 @@ define('DB_FETCHMODE_DEFAULT', MDB2_FETCHMODE_DEFAULT); define('DB_FETCHMODE_ORDERED', MDB2_FETCHMODE_ORDERED); define('DB_FETCHMODE_ASSOC', MDB2_FETCHMODE_ASSOC); -define('DB_FETCHMODE_OBJECT', 3); +define('DB_FETCHMODE_OBJECT', MDB2_FETCHMODE_OBJECT); define('DB_FETCHMODE_FLIPPED', MDB2_FETCHMODE_FLIPPED); define('DB_GETMODE_ORDERED', DB_FETCHMODE_ORDERED); @@ -245,7 +245,7 @@ return $this->result->fetch(); } - function fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null) + function &fetchrow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null) { return $this->result->fetchRow($fetchmode); } @@ -289,7 +289,7 @@ function getRowCounter() { - return $this->result->rownum+1; + return $this->result->getRowCounter()+1; } }
« previous php.pear.cvs (#18990) next »