Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
...so that database will reconnect automatically if connection was broken (tested)
if $db->autoReconnect = true the database would reconnect upon the next query but fail to reset() MysqliDb (for example select now() would work after a break in connection, but not queries requiring prepare.)
With the try / catch block MysqliDb will gracefully reconnect if the connection was broken in-between queries and continue to run the query as if nothing happened (LINE)
If the statement is null, it will also try to reconnect (this happens if the server is down and the query has attempted executed one or more times while the connection is down.) (LINE)
TODO: Better fix is to push code checking for reconnect up the stack further before the object is built up which avoids the "piling up" of parameters in the prepared statement as the query retries while the server is down:
e.g. mysqli_stmt->bind_param(string ssississississississississississississississississississississi, ...