Skip to content

Commit

Permalink
fixed exception issue
Browse files Browse the repository at this point in the history
  • Loading branch information
joykumarbera committed Aug 20, 2022
1 parent 32c5688 commit 4a101fe
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,6 @@ private function _runQuery($sql, $params)
{
try {
$this->stmt = $this->con->prepare($sql);
if($this->stmt === false) {
throw new DbErrorException('DB error :: ' . $this->con->error );
}
} catch(mysqli_sql_exception $e) {
throw new DbErrorException('DB error :: ' . $this->con->error );
}
Expand All @@ -317,11 +314,12 @@ private function _runQuery($sql, $params)
$this->stmt->bind_param($type_str, ...$params);
}

if($this->stmt->execute()) {
try {
$this->stmt->execute();
$this->query_result = $this->stmt->get_result();
return true;
} else {
throw new DbErrorException("DB error :: " . $this->stmt->error);
} catch(mysqli_sql_exception $e) {
throw new DbErrorException("DB error :: " . $e->getMessage());
}
}

Expand Down

0 comments on commit 4a101fe

Please sign in to comment.