mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-13 16:34:52 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@226 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
30127ae3e6
commit
ea69a65507
5 changed files with 13 additions and 9 deletions
|
|
@ -164,7 +164,7 @@
|
|||
$output = $this->_executeInsertAct($tables, $column, $pass_quotes);
|
||||
break;
|
||||
case 'update' :
|
||||
$output = $this->_executeUpdateAct($tables, $column, $condition, $pass_quotes);
|
||||
$output = $this->_executeUpdateAct($tables, $column, $args, $condition, $pass_quotes);
|
||||
break;
|
||||
case 'delete' :
|
||||
$output = $this->_executeDeleteAct($tables, $condition, $pass_quotes);
|
||||
|
|
|
|||
|
|
@ -287,10 +287,12 @@
|
|||
/**
|
||||
* @brief updateAct 처리
|
||||
**/
|
||||
function _executeUpdateAct($tables, $column, $condition, $pass_quotes) {
|
||||
function _executeUpdateAct($tables, $column, $args, $condition, $pass_quotes) {
|
||||
$table = array_pop($tables);
|
||||
|
||||
foreach($column as $key => $val) {
|
||||
// args에 아예 해당 key가 없으면 패스
|
||||
if(!isset($args->{$key})) continue;
|
||||
if(in_array($key, $pass_quotes)) $update_list[] = sprintf('`%s` = %s', $key, $this->addQuotes($val));
|
||||
else $update_list[] = sprintf('`%s` = \'%s\'', $key, $this->addQuotes($val));
|
||||
}
|
||||
|
|
@ -300,7 +302,8 @@
|
|||
if($condition) $condition = ' where '.$condition;
|
||||
|
||||
$query = sprintf("update `%s%s` set %s %s;", $this->prefix, $table, $update_query, $condition);
|
||||
return $this->_query($query);
|
||||
|
||||
return $this->_query($query);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue