public function replace($data, $options = array())
{
foreach ($data as $key => $val) {
$value = $this->parseValue($val);
if (is_scalar($value)) {
// 过滤非标量数据
$values[] = $value;
$fields[] = $this->parseKey($key);
}
}
$sql = 'REPLACE INTO ' . $this->parseTable($options['table']) . ' (' . implode(',', $fields) . ') VALUES (' . implode(',', $values) . ')';
return $this->execute($sql);
}