From 40f8d9abf957517677133c49b366b89c53e2184c Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 18 Feb 2022 15:14:02 +0000 Subject: [PATCH] fixed a bug in pdo_driver.php --- codepot/src/system/database/drivers/pdo/pdo_driver.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/codepot/src/system/database/drivers/pdo/pdo_driver.php b/codepot/src/system/database/drivers/pdo/pdo_driver.php index 29b2cd01..899654df 100644 --- a/codepot/src/system/database/drivers/pdo/pdo_driver.php +++ b/codepot/src/system/database/drivers/pdo/pdo_driver.php @@ -273,7 +273,13 @@ class CI_DB_pdo_driver extends CI_DB { function _execute($sql) { $sql = $this->_prep_query($sql); - $result_id = new CI_DB_pdo_statement_wrapper($this->conn_id->prepare($sql)); + $stmt = $this->conn_id->prepare($sql); + if ($stmt === FALSE) + { + $this->affect_rows = 0; + return FALSE; + } + $result_id = new CI_DB_pdo_statement_wrapper($stmt); if (is_object($result_id) && $result_id->execute()) {