Commit 6407b01c authored by Alexander Butenko's avatar Alexander Butenko

More valid getLastQuery() output

parent c99d2610
...@@ -329,7 +329,7 @@ class MysqliDb ...@@ -329,7 +329,7 @@ class MysqliDb
if ($this->isSubQuery) if ($this->isSubQuery)
return; return;
$this->_query = "INSERT into " .self::$_prefix . $tableName; $this->_query = "INSERT INTO " .self::$_prefix . $tableName;
$stmt = $this->_buildQuery(null, $insertData); $stmt = $this->_buildQuery(null, $insertData);
$stmt->execute(); $stmt->execute();
$this->_stmtError = $stmt->error; $this->_stmtError = $stmt->error;
...@@ -721,8 +721,8 @@ class MysqliDb ...@@ -721,8 +721,8 @@ class MysqliDb
$isUpdate = strpos ($this->_query, 'UPDATE'); $isUpdate = strpos ($this->_query, 'UPDATE');
if ($isInsert !== false) { if ($isInsert !== false) {
$this->_query .= '(`' . implode(array_keys($tableData), '`, `') . '`)'; $this->_query .= ' (`' . implode(array_keys($tableData), '`, `') . '`)';
$this->_query .= ' VALUES('; $this->_query .= ' VALUES (';
} else } else
$this->_query .= " SET "; $this->_query .= " SET ";
...@@ -778,7 +778,7 @@ class MysqliDb ...@@ -778,7 +778,7 @@ class MysqliDb
return; return;
//Prepair the where portion of the query //Prepair the where portion of the query
$this->_query .= ' WHERE '; $this->_query .= ' WHERE';
// Remove first AND/OR concatenator // Remove first AND/OR concatenator
$this->_where[0][0] = ''; $this->_where[0][0] = '';
...@@ -937,7 +937,9 @@ class MysqliDb ...@@ -937,7 +937,9 @@ class MysqliDb
$val = $vals[$i++]; $val = $vals[$i++];
if (is_object ($val)) if (is_object ($val))
$val = '[object]'; $val = '[object]';
$newStr .= substr ($str, 0, $pos) . $val; if ($val == NULL)
$val = 'NULL';
$newStr .= substr ($str, 0, $pos) . "'". $val . "'";
$str = substr ($str, $pos + 1); $str = substr ($str, $pos + 1);
} }
$newStr .= $str; $newStr .= $str;
......
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