diff --git a/system/databases/mysql.class.php b/system/databases/mysql.class.php index 5133370cd..c2a247525 100755 --- a/system/databases/mysql.class.php +++ b/system/databases/mysql.class.php @@ -277,7 +277,7 @@ function dbQuery($sql,$ignore_errors=0) } // Modifies "CREATE TABLE" SQL - if (preg_match('/create\s+table\s/i', $sql)) { + if (preg_match('/^\s*create\s\s*table\s/i', $sql)) { $p = strrpos($sql, ')'); if ($p !== FALSE) { diff --git a/system/databases/mysqli.class.php b/system/databases/mysqli.class.php index 62c60d1fb..945b7792c 100644 --- a/system/databases/mysqli.class.php +++ b/system/databases/mysqli.class.php @@ -241,7 +241,7 @@ public function dbQuery($sql, $ignore_errors=0) } // Modifies "CREATE TABLE" SQL - if (preg_match('/create\s+table\s/i', $sql)) { + if (preg_match('/^\s*create\s\s*table\s/i', $sql)) { $p = strrpos($sql, ')'); if ($p !== FALSE) {