From 44e73027a11f48d01c8257bd204057504b1c32ae Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 4 Oct 2020 16:46:51 +0900 Subject: [PATCH] Don't fetch if the query isn't SELECT https://xetown.com/questions/1464687 --- common/framework/db.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/framework/db.php b/common/framework/db.php index 45b0fffeb..55dba31cd 100644 --- a/common/framework/db.php +++ b/common/framework/db.php @@ -335,10 +335,14 @@ class DB $this->_total_time += (microtime(true) - $start_time); return $output; } - else + elseif ($query->type === 'SELECT') { $result = $this->_fetch($this->_last_stmt, $last_index, $result_type); } + else + { + $result = null; + } } catch (Exceptions\DBError $e) {