From 00764b92d6908221fca8616171d563946d75697d Mon Sep 17 00:00:00 2001 From: Eduardo Malherbi Date: Tue, 5 Jun 2018 11:50:35 -0300 Subject: [PATCH] fix #14 --- src/MyMssql.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MyMssql.php b/src/MyMssql.php index a548122..18ba57c 100755 --- a/src/MyMssql.php +++ b/src/MyMssql.php @@ -122,7 +122,13 @@ public function fetchOne($sql) $this->logger('MyMssql Fetch One: '.json_encode($result)); } - return empty($result) ? false : array_values($result)[0]; + $result = empty($result) ? false : array_values($result); + + if (is_array($result)) { + return $result[0]; + } + + return false; } public function fetchRow($sql)