From ea959071473b029d47ed8b7a6b0b6eb65b279aff Mon Sep 17 00:00:00 2001 From: ninadsp Date: Wed, 14 Jul 2010 20:21:10 +0530 Subject: [PATCH] Improved the error handling, when an empty result set is obtained. --- js/sql.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/js/sql.js b/js/sql.js index 0d048343a..b531b1336 100644 --- a/js/sql.js +++ b/js/sql.js @@ -24,9 +24,17 @@ $(document).ready(function() { $(this).append(''); $.post($(this).attr('action'), $(this).serialize() , function(data) { - $("#sqlqueryresults").html(data); - if($("#togglequerybox").siblings(":visible").length > 0) { - $("#togglequerybox").trigger('click'); + if(data.success == true) { + PMA_ajaxShowMessage(data.message); + } + else if (data.success == false ) { + PMA_ajaxShowMessage(data.error); + } + else { + $("#sqlqueryresults").html(data); + if($("#togglequerybox").siblings(":visible").length > 0) { + $("#togglequerybox").trigger('click'); + } } }) }) // end SQL Query submit