Commit 09f36df7 authored by Alexander Butenko's avatar Alexander Butenko

Support join in delete()

parent e4b060d6
......@@ -607,7 +607,11 @@ class MysqliDb
if ($this->isSubQuery)
return;
$this->_query = "DELETE FROM " . self::$prefix . $tableName;
$table = self::$prefix . $tableName;
if (count ($this->_join))
$this->_query = "DELETE " . preg_replace ('/.* (.*)/', '$1', $table) . " FROM " . $table;
else
$this->_query = "DELETE FROM " . $table;
$stmt = $this->_buildQuery($numRows);
$stmt->execute();
......
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