From 45a1e1e78ac2171f0dfc5b9c76cbb306e6231cc2 Mon Sep 17 00:00:00 2001 From: Von Hirsch Date: Tue, 24 Apr 2018 16:46:56 -0400 Subject: [PATCH] Set db->count with affected_rows on delete --- MysqliDb.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MysqliDb.php b/MysqliDb.php index 6a55bddf..e15f46c6 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -888,9 +888,10 @@ public function delete($tableName, $numRows = null) $stmt->execute(); $this->_stmtError = $stmt->error; $this->_stmtErrno = $stmt->errno; + $this->count = $stmt->affected_rows; $this->reset(); - return ($stmt->affected_rows > -1); // affected_rows returns 0 if nothing matched where statement, or required updating, -1 if error + return ($stmt->affected_rows > -1); // -1 indicates that the query returned an error } /**