protected function _replaceParameters($sql, array $args)
{
$paramCount = substr_count($sql, '?');
if (count($args) != $paramCount) {
$this->_logError('Parameter count mismatch: ' . $sql, 'Horde_Db_Adapter_Base::_replaceParameters');
throw new Horde_Db_Exception(sprintf('Parameter count mismatch, expecting %d, got %d', $paramCount, count($args)));
}
$sqlPieces = explode('?', $sql);
$sql = array_shift($sqlPieces);
while (count($sqlPieces)) {
$sql .= $this->quote(array_shift($args)) . array_shift($sqlPieces);
}
return $sql;
}