Commit 8f36a33f authored by Jeffrey Way's avatar Jeffrey Way

Small bug fix

parent f4925894
...@@ -189,23 +189,21 @@ class MysqlDB { ...@@ -189,23 +189,21 @@ class MysqlDB {
} }
// Determine if is INSERT query // Determine if is INSERT query
if ($hasTableData && $this->_crudType == 'insert') { if ($hasTableData && $this->_crudType == 'insert') {
if ( $this->_crudType == 'insert' ) { $keys = array_keys($tableData);
$keys = array_keys($tableData); $values = array_values($tableData);
$values = array_values($tableData); $num = count($keys);
$num = count($keys);
// wrap values in quotes
// wrap values in quotes foreach ($values as $key => $val) {
foreach ($values as $key => $val) { $values[$key] = "'{$val}'";
$values[$key] = "'{$val}'"; $this->_paramTypeList .= $this->_determineType($val);
$this->_paramTypeList .= $this->_determineType($val); }
}
$this->_query .= '(' . implode($keys, ', ') . ')'; $this->_query .= '(' . implode($keys, ', ') . ')';
$this->_query .= ' VALUES('; $this->_query .= ' VALUES(';
while ($num !== 0) { while ($num !== 0) {
($num !== 1) ? $this->_query .= '?, ' : $this->_query .= '?)'; ($num !== 1) ? $this->_query .= '?, ' : $this->_query .= '?)';
$num--; $num--;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment