Skip to content

Commit bc561cc

Browse files
VonHirschavbdr
authored andcommitted
Set db->count with affected_rows on delete (#750)
1 parent 2ab6651 commit bc561cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

MysqliDb.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,9 +888,10 @@ public function delete($tableName, $numRows = null)
888888
$stmt->execute();
889889
$this->_stmtError = $stmt->error;
890890
$this->_stmtErrno = $stmt->errno;
891+
$this->count = $stmt->affected_rows;
891892
$this->reset();
892893

893-
return ($stmt->affected_rows > -1); // affected_rows returns 0 if nothing matched where statement, or required updating, -1 if error
894+
return ($stmt->affected_rows > -1); // -1 indicates that the query returned an error
894895
}
895896

896897
/**

0 commit comments

Comments
 (0)