Skip to content

Commit

Permalink
Improve error handling in prepared statements
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilaBorowska committed Oct 21, 2019
1 parent d59bb6c commit eaacf54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ntbb-database.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ function query($query, $params=false) {
$this->connect();
if ($params) {
$stmt = $this->db->prepare($query);
$stmt->execute($params);
$execution_result = $stmt->execute($params);
if (!$execution_result) {
return null;
}
return $stmt;
} else {
return $this->db->query($query);
Expand Down

0 comments on commit eaacf54

Please sign in to comment.