Strange question, but I can not find. How in PDO to check whether the request to the database was successful?$result = $this->db->query($q); Returns Object always.
public function query($sql, $params = []) { $stmt = $this->db->prepare($sql); if (!empty($params)) { foreach ($params as $key => $val) { $stmt->bindValue(':'.$key, $val); } } $stmt->execute(); return $stmt; }