From d8c7f8d190b9215959b68a5272c76e9b79371999 Mon Sep 17 00:00:00 2001 From: Emrul Easir Date: Fri, 29 Mar 2019 03:29:17 +0600 Subject: NOT BETWEEN syntax error DB where() issue solved While creating a SQL query string using query builder, NOT BETWEEN operator adds a syntax error, Solution added to _has_operator() and _get_operator() method. --- system/database/DB_driver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index b4f16b905..e901f2948 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1476,7 +1476,7 @@ abstract class CI_DB_driver { */ protected function _has_operator($str) { - return (bool) preg_match('/(<|>|!|=|\sIS NULL|\sIS NOT NULL|\sEXISTS|\sBETWEEN|\sLIKE|\sIN\s*\(|\s)/i', trim($str)); + return (bool) preg_match('/(<|>|!|=|\sIS NULL|\sIS NOT NULL|\sEXISTS|\sBETWEEN|\s NOT BETWEEN|\sLIKE|\sIN\s*\(|\s)/i', trim($str)); } // -------------------------------------------------------------------- @@ -1505,6 +1505,7 @@ abstract class CI_DB_driver { '\s+EXISTS\s*\(.*\)', // EXISTS(sql) '\s+NOT EXISTS\s*\(.*\)', // NOT EXISTS(sql) '\s+BETWEEN\s+', // BETWEEN value AND value + '\s+NOT BETWEEN\s+', // NOT BETWEEN value AND value '\s+IN\s*\(.*\)', // IN(list) '\s+NOT IN\s*\(.*\)', // NOT IN (list) '\s+LIKE\s+\S.*('.$_les.')?', // LIKE 'expr'[ ESCAPE '%s'] -- cgit v1.2.3-24-g4f1b