Skip to content

Commit

Permalink
Set db->count with affected_rows on delete (ThingEngineer#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
VonHirsch authored and avbdr committed Oct 11, 2018
1 parent 2ab6651 commit bc561cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MysqliDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down

0 comments on commit bc561cc

Please sign in to comment.