fix MySQLi class

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6953 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2009-11-19 04:39:27 +00:00
parent 4a52404bb7
commit 6ab07bbaa5

View file

@ -73,7 +73,7 @@
// db 정보가 없으면 무시
if(!$this->hostname || !$this->userid || !$this->password || !$this->database) return;
// 접속시도
// 접속시도
if($this->port){
$this->fd = mysqli_connect($this->hostname, $this->userid, $this->password, $this->database, $this->port);
}else{
@ -421,22 +421,20 @@
$table_list[] = '`'.$this->prefix.$val.'`';
}
// 컬럼 정리
// 컬럼 정리
foreach($output->columns as $key => $val) {
$name = $val['name'];
$value = $val['value'];
$value_list = array();
if($output->column_type[$name]!='number') {
$value = "'".$this->addQuotes($value)."'";
if(!$value) $value = 'null';
} elseif(!$value || is_numeric($value)) $value = (int)$value;
$column_list[] = '`'.$name.'`';
$value_list[] = $value;
}
$query = sprintf("insert into %s (%s) values (%s);", implode(',',$table_list), implode(',',$column_list), implode(',', $value_list));
$query = sprintf("insert into %s (%s) values (%s)", implode(',',$table_list), implode(',',$column_list), implode(',', $value_list));
return $this->_query($query);
}
@ -450,7 +448,7 @@
$table_list[] = '`'.$this->prefix.$val.'` as '.$key;
}
// 컬럼 정리
// 컬럼 정리
foreach($output->columns as $key => $val) {
if(!isset($val['value'])) continue;
$name = $val['name'];