diff --git a/ludicrousdb/includes/class-ludicrousdb.php b/ludicrousdb/includes/class-ludicrousdb.php index 18f2247..106f8c1 100644 --- a/ludicrousdb/includes/class-ludicrousdb.php +++ b/ludicrousdb/includes/class-ludicrousdb.php @@ -1553,10 +1553,18 @@ protected function _do_query( $query, $dbh_or_table = false ) { // phpcs:ignore return false; } - if ( true === $this->use_mysqli ) { - $result = mysqli_query( $dbh, $query ); - } else { - $result = mysql_query( $query, $dbh ); + try { + if ( true === $this->use_mysqli ) { + $result = mysqli_query( $dbh, $query ); + } else { + $result = mysql_query( $query, $dbh ); + } + } catch ( Throwable $exception ) { + if ( true === $this->suppress_errors ) { + $result = false; + } else { + throw $exception; + } } // Maybe log last used to heartbeats