From 7724f1f6f8bee40cd3490f0dbd14f863db17f101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Thu, 3 Apr 2025 15:35:02 +0900 Subject: [PATCH] dbms_primeidc_init...1 --- extdbms/lib/Core/Model.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/extdbms/lib/Core/Model.php b/extdbms/lib/Core/Model.php index 3c08536..2ad8d7b 100644 --- a/extdbms/lib/Core/Model.php +++ b/extdbms/lib/Core/Model.php @@ -119,16 +119,20 @@ abstract class Model final public function execute(string $query): bool|PDOStatement { - if ($this->_debug) { - echo "\n
Query:" . $query . "\n
"; + try { + if ($this->_debug) { + echo "\n
Query:" . $query . "\n
"; + } + $this->_lastQuery = $query; + $stmt = $this->getConnect()->prepare($query); + $stmt->execute(); + if ($this->_reset) { + $this->reset(); + } + return $stmt; + } catch (\Exception $e) { + die($e->getMessage()); } - $this->_lastQuery = $query; - $stmt = $this->getConnect()->prepare($query); - $stmt->execute(); - if ($this->_reset) { - $this->reset(); - } - return $stmt; } //CURD문