cvs: pear /MDB2 MDB2.php
| From: | Lukas Smith | Date: | Mon, 23 May 2005 19:36:45 +0000 |
| Subject: | cvs: pear /MDB2 MDB2.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-32079@lists.php.net to get a copy of this message | ||
lsmith Mon May 23 15:36:45 2005 EDT
Modified files:
/pear/MDB2 MDB2.php
Log:
- CS fixes
- fixed bug in _assignBindColumns() when using associative fetches
http://cvs.php.net/diff.php/pear/MDB2/MDB2.php?r1=1.101&r2=1.102&ty=u
Index: pear/MDB2/MDB2.php
diff -u pear/MDB2/MDB2.php:1.101 pear/MDB2/MDB2.php:1.102
--- pear/MDB2/MDB2.php:1.101 Sat May 21 19:05:39 2005
+++ pear/MDB2/MDB2.php Mon May 23 15:36:42 2005
@@ -43,7 +43,7 @@
// | Author: Lukas Smith <smith@backendmedia.com> |
// +----------------------------------------------------------------------+
//
-// $Id: MDB2.php,v 1.101 2005/05/21 23:05:39 lsmith Exp $
+// $Id: MDB2.php,v 1.102 2005/05/23 19:36:42 lsmith Exp $
//
/**
@@ -1523,7 +1523,7 @@
function __call($method, $params)
{
$module = null;
- if(preg_match('/^([a-z]+)([A-Z])(.*)$/', $method, $match)
+ if (preg_match('/^([a-z]+)([A-Z])(.*)$/', $method, $match)
&& isset($this->options['modules'][$match[1]])
) {
$module = $this->options['modules'][$match[1]];
@@ -1535,7 +1535,7 @@
}
}
} else {
- foreach($this->modules as $key => $foo) {
+ foreach ($this->modules as $key => $foo) {
if (is_object($this->modules[$key])
&& method_exists($this->modules[$key], $method)
) {
@@ -2099,9 +2099,9 @@
$c_position = strpos($query, $colon, $position);
if ($q_position && $c_position) {
$p_position = min($q_position, $c_position);
- } elseif($q_position) {
+ } elseif ($q_position) {
$p_position = $q_position;
- } elseif($c_position) {
+ } elseif ($c_position) {
$p_position = $c_position;
} else {
break;
@@ -2570,7 +2570,6 @@
*/
function fetchOne($colnum = 0)
{
- $column = array();
$fetchmode = is_numeric($colnum) ? MDB2_FETCHMODE_ORDERED : MDB2_FETCHMODE_ASSOC;
$row = $this->fetchRow($fetchmode);
if (!is_array($row) || PEAR::isError($row)) {
@@ -2645,7 +2644,7 @@
$shift_array = $rekey ? false : null;
if (!is_null($shift_array)) {
- if(is_object($row)) {
+ if (is_object($row)) {
$colnum = count(get_object_vars($row));
} else {
$colnum = count($row);
@@ -2845,6 +2844,7 @@
*/
function _assignBindColumns($row)
{
+ $row = array_values($row);
foreach ($row as $column => $value) {
if (array_key_exists($column, $this->values)) {
$this->values[$column] = $value;