From ea9f7d335aff00546e2dbeba2e176d6aa99f88c6 Mon Sep 17 00:00:00 2001 From: Callum West Date: Fri, 27 Jun 2014 11:51:41 +0100 Subject: Update Db.class.php Added option for "SHOW" query, and changed requirement to check for first 6 letters. Not all query types are words with 6 letters. --- Db.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Db.class.php b/Db.class.php index c96434a..fe11d36 100644 --- a/Db.class.php +++ b/Db.class.php @@ -172,9 +172,10 @@ class DB $this->Init($query,$params); # The first six letters of the sql statement -> insert, select, etc... - $statement = strtolower(substr($query, 0 , 6)); + $rawStatement = explode(" ",$query); + $statement = strtolower($rawStatement[0]); - if ($statement === 'select') { + if ($statement === 'select' || $statement === 'show') { return $this->sQuery->fetchAll($fetchmode); } elseif ( $statement === 'insert' || $statement === 'update' || $statement === 'delete' ) { -- cgit v1.1