From 62e5e7d10201ece1bae2d1f822b6e5d897506779 Mon Sep 17 00:00:00 2001 From: Oldperl <44996956+oldperl@users.noreply.github.com> Date: Fri, 9 Jun 2017 09:24:59 +0000 Subject: [PATCH] fixed error in query_id check --- conlib/db_mysqli.inc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/conlib/db_mysqli.inc b/conlib/db_mysqli.inc index 4fa4808..78e06a7 100644 --- a/conlib/db_mysqli.inc +++ b/conlib/db_mysqli.inc @@ -173,7 +173,7 @@ class DB_Sql extends DB_Sql_Abstract { $this->Row = 0; $this->Errno = $this->_getErrorNumber(); $this->Error = $this->_getErrorMessage(); - if (!is_resource($this->Query_ID)) { + if (!$this->Query_ID) { $this->halt($sQuery); } } @@ -360,15 +360,14 @@ class DB_Sql extends DB_Sql_Abstract { if (!empty($table)) { $this->connect(); $id = mysqli_query($this->Link_ID, sprintf("SELECT * FROM `%s` LIMIT 1", $table)); - if (!is_resource($id)) { + if (!$id) { $this->halt('Metadata query failed.'); return false; } } else { //var_dump($this->Query_ID); $id = $this->Query_ID; - if (!$id instanceof mysqli_result) { - echo "back"; + if (!$id) { $this->halt('No query specified.'); return false; }