Index: library/Zend/Db/Adapter/Abstract.php =================================================================== --- library/Zend/Db/Adapter/Abstract.php (revision 6350) +++ library/Zend/Db/Adapter/Abstract.php (working copy) @@ -532,7 +532,7 @@ return $result; } - /** + /** * Convert an array, string, or Zend_Db_Expr object * into a string to put in a WHERE clause. * @@ -547,13 +547,22 @@ if (!is_array($where)) { $where = array($where); } - foreach ($where as &$term) { - if ($term instanceof Zend_Db_Expr) { - $term = $term->__toString(); + foreach ($where as $cond => &$term) { + // is $cond an int? (i.e. Not a condition) + if (is_int($cond)) { + // $term is the full condition + if ($term instanceof Zend_Db_Expr) { + $term = $term->__toString(); + } + } else { + // $cond is the condition with placeholder, + // and $term is quoted into the condition + $term = $this->quoteInto($cond, $term); } - $term = '(' . $term . ')'; - } - $where = implode(' AND ', $where); + $term = '(' . $term . ')'; + } + + $where = implode(' AND ', $where); return $where; }