Skip to content

Commit

Permalink
Database: Fix catch exception
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-schindler committed Oct 27, 2022
1 parent 75c17d2 commit a869854
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Backend/Core/Data/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ public function __construct()
*
* @param string $queryStr SQL query as string
* @param array<string,string> $values Escaped values
* @throws PDOException When anything goes wrong
* @return bool Whether the query was executed successfully
*/
public function execute(string $queryStr, array $values): bool
{
$this->query = $this->prepare($queryStr);

if ($this->query !== false)
try {
$this->query = $this->prepare($queryStr);
return $this->query->execute($values);
return false;
} catch (PDOException) {
return false;
}
}

/**
Expand Down

0 comments on commit a869854

Please sign in to comment.