From ea0f6d0210d2985213d07f1a53594754c50410ab Mon Sep 17 00:00:00 2001 From: Samith Dassanayake Date: Wed, 20 Feb 2013 18:14:53 +0530 Subject: [PATCH 1/2] Fixed #3830 Can't export custom query because it lowercases table names --- tbl_export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tbl_export.php b/tbl_export.php index 6fe310896c..5852ec5319 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -37,7 +37,7 @@ if (! empty($sql_query)) { // Need to generate WHERE clause? if (isset($where_clause)) { - $temp_sql_array = explode("where", strtolower($sql_query)); + $temp_sql_array = explode("where", $sql_query); // The part "SELECT `id`, `name` FROM `customers`" // is not modified by the next code segment, when exporting From ae3d3f5a849b22b41e86d210f005dce8d631ce24 Mon Sep 17 00:00:00 2001 From: Samith Dassanayake Date: Wed, 20 Feb 2013 20:06:57 +0530 Subject: [PATCH 2/2] Used preg_split() instead of explode() to split sql query, Since explode is case sensitive and if table or column contains substring "where" it will give an error --- tbl_export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tbl_export.php b/tbl_export.php index 5852ec5319..557dcb352b 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -37,7 +37,7 @@ if (! empty($sql_query)) { // Need to generate WHERE clause? if (isset($where_clause)) { - $temp_sql_array = explode("where", $sql_query); + $temp_sql_array = preg_split("/\bwhere\b/i", $sql_query); // The part "SELECT `id`, `name` FROM `customers`" // is not modified by the next code segment, when exporting