From f07afe9c58f7012a0703632e7672fa1afd130bb1 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 14 Jan 2021 22:39:43 +0900 Subject: [PATCH] Unset $this->_last_stmt before next query --- common/framework/db.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/framework/db.php b/common/framework/db.php index 4d1d0c9ba..fa1035716 100644 --- a/common/framework/db.php +++ b/common/framework/db.php @@ -165,6 +165,7 @@ class DB } // Create and return a prepared statement. + $this->_last_stmt = null; $this->_last_stmt = $this->_handle->prepare($statement, $driver_options); return $this->_last_stmt; } @@ -202,6 +203,7 @@ class DB } // Execute either a prepared statement or a regular query depending on whether there are arguments. + $this->_last_stmt = null; if (count($args)) { $this->_last_stmt = $this->_handle->prepare($query_string); @@ -337,6 +339,7 @@ class DB } $this->_query_id = $query_id; + $this->_last_stmt = null; if (count($query_params)) { $this->_last_stmt = $this->_handle->prepare($query_string); @@ -421,6 +424,7 @@ class DB $query_string .= "\n" . sprintf('/* %s %s */', $query_id, \RX_CLIENT_IP); } + $this->_last_stmt = null; if (count($query_params)) { $this->_last_stmt = $this->_handle->prepare($query_string); @@ -488,6 +492,7 @@ class DB $query_string .= "\n" . sprintf('/* _query() %s */', \RX_CLIENT_IP); } + $this->_last_stmt = null; $this->_last_stmt = $this->_handle->query($query_string); return $this->_last_stmt; }