Commit 38e00c47 authored by Alexander Butenko's avatar Alexander Butenko

Add limit support to update

parent 549494d0
...@@ -660,10 +660,12 @@ class MysqliDb ...@@ -660,10 +660,12 @@ class MysqliDb
* *
* @param string $tableName The name of the database table to work with. * @param string $tableName The name of the database table to work with.
* @param array $tableData Array of data to update the desired row. * @param array $tableData Array of data to update the desired row.
* @param int|array $numRows Array to define SQL limit in format Array ($count, $offset)
* or only $count
* *
* @return bool * @return bool
*/ */
public function update($tableName, $tableData) public function update($tableName, $tableData, $numRows = null)
{ {
if ($this->isSubQuery) { if ($this->isSubQuery) {
return; return;
...@@ -671,7 +673,7 @@ class MysqliDb ...@@ -671,7 +673,7 @@ class MysqliDb
$this->_query = "UPDATE " . self::$prefix . $tableName; $this->_query = "UPDATE " . self::$prefix . $tableName;
$stmt = $this->_buildQuery(null, $tableData); $stmt = $this->_buildQuery($numRows, $tableData);
$status = $stmt->execute(); $status = $stmt->execute();
$this->reset(); $this->reset();
$this->_stmtError = $stmt->error; $this->_stmtError = $stmt->error;
......
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