Skip to content

Commit 38e00c4

Browse files
committed
Add limit support to update
1 parent 549494d commit 38e00c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

MysqliDb.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,18 +660,20 @@ public function has($tableName)
660660
*
661661
* @param string $tableName The name of the database table to work with.
662662
* @param array $tableData Array of data to update the desired row.
663+
* @param int|array $numRows Array to define SQL limit in format Array ($count, $offset)
664+
* or only $count
663665
*
664666
* @return bool
665667
*/
666-
public function update($tableName, $tableData)
668+
public function update($tableName, $tableData, $numRows = null)
667669
{
668670
if ($this->isSubQuery) {
669671
return;
670672
}
671673

672674
$this->_query = "UPDATE " . self::$prefix . $tableName;
673675

674-
$stmt = $this->_buildQuery(null, $tableData);
676+
$stmt = $this->_buildQuery($numRows, $tableData);
675677
$status = $stmt->execute();
676678
$this->reset();
677679
$this->_stmtError = $stmt->error;

0 commit comments

Comments
 (0)