Permalink
Browse files

Throw error if no sql query is set

  • Loading branch information...
1 parent 24275dd commit ffd2e5b46ccc0a67bba05d08cc4b98d479611f60 @madhuracj madhuracj committed Jan 27, 2013
Showing with 10 additions and 1 deletion.
  1. +10 −1 tbl_gis_visualization.php
View
11 tbl_gis_visualization.php
@@ -16,6 +16,16 @@
// Import visualization functions
require_once 'libraries/gis_visualization.lib.php';
+$response = PMA_Response::getInstance();
+// Throw error if no sql query is set
+if (! isset($sql_query) || $sql_query == '') {
+ $response->isSuccess(false);
+ $response->addHTML(
+ PMA_Message::error(__('No SQL query was set to fetch data.'))
+ );
+ exit;
+}
+
// Execute the query and return the result
$result = PMA_DBI_try_query($sql_query);
// Get the meta data of results
@@ -55,7 +65,6 @@
$data[] = $row;
}
-$response = PMA_Response::getInstance();
if (isset($_REQUEST['saveToFile'])) {
$response->disable();
$file_name = $_REQUEST['fileName'];

0 comments on commit ffd2e5b

Please sign in to comment.