Skip to content

Commit

Permalink
Update Connection.php
Browse files Browse the repository at this point in the history
codeigniter4#1559  - if there is no affected_rows set it is better to return 0 instead of exception :)
  • Loading branch information
nowackipawel authored Nov 30, 2018
1 parent 1680e90 commit cc8fdda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/Database/MySQLi/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ protected function prepQuery($sql)
*/
public function affectedRows(): int
{
return $this->connID->affected_rows;
return $this->connID->affected_rows ?? 0;
}

//--------------------------------------------------------------------
Expand Down

0 comments on commit cc8fdda

Please sign in to comment.