mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-28 23:59:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@976 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
bea526381b
commit
d67dbc59b4
1 changed files with 7 additions and 10 deletions
|
|
@ -366,21 +366,18 @@
|
||||||
foreach($column as $key => $val) {
|
foreach($column as $key => $val) {
|
||||||
// args에 아예 해당 key가 없으면 패스
|
// args에 아예 해당 key가 없으면 패스
|
||||||
if(!isset($args->{$key})) continue;
|
if(!isset($args->{$key})) continue;
|
||||||
|
if(in_array($key, $pass_quotes)) $update_list[] = sprintf('`%s` = %s', $key, $this->addQuotes($val));
|
||||||
$update_list[] = sprintf('%s = ?', $key);
|
else {
|
||||||
$val_list[] = $this->addQuotes($val);
|
if(is_numeric($val)) $update_list[] = sprintf('`%s` = %s', $key, $val);
|
||||||
|
else $update_list[] = sprintf('`%s` = \'%s\'', $key, $this->addQuotes($val));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!count($update_list)) return;
|
if(!count($update_list)) return;
|
||||||
|
|
||||||
$update_query = implode(',',$update_list);
|
$update_query = implode(',',$update_list);
|
||||||
if($condition) $condition = ' WHERE '.$condition;
|
if($condition) $condition = ' where '.$condition;
|
||||||
$query = sprintf("UPDATE %s%s SET %s %s;", $this->prefix, $table, $update_query, $condition);
|
$query = sprintf("update `%s%s` set %s %s;", $this->prefix, $table, $update_query, $condition);
|
||||||
|
|
||||||
$this->_prepare($query);
|
$this->_prepare($query);
|
||||||
|
|
||||||
$val_count = count($val_list);
|
|
||||||
for($i=0;$i<$val_count;$i++) $this->_bind($val_list[$i]);
|
|
||||||
|
|
||||||
$this->_execute();
|
$this->_execute();
|
||||||
return $this->isError();
|
return $this->isError();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue