public function query($sql) { $sth = $this->connection->prepare($sql); if (!$sth->execute()) { $this->showError($sth->errorCode(), $sth->errorInfo()); } else { $this->result = $sth; } }