From 2e379d864793ac1c32bbdf407f36332cdc5d3c2d Mon Sep 17 00:00:00 2001
From: DSB
', $sqlObject->getErrors());
- }
- $statements = $parser->getParsedStatements();
- foreach ($statements as $statement) {
- //echo "
Extracted statement: ".$statement;
- try {
- $res = $this->_db->query($statement, Msd_Db::ARRAY_ASSOC);
- $this->view->resultset = $res;
- } catch (Exception $e) {
- $this->view->errorMessage = $e->getMessage();
+ } else {
+ $statements = $parser->getParsedStatements();
+ if (sizeof($statements) > 1) {
+ // we have more than one query to execute
+ foreach ($statements as $statement) {
+ try {
+ $this->_db->query($statement, Msd_Db::ARRAY_ASSOC);
+ } catch (Exception $e) {
+ $this->view->errorMessage = $e->getMessage();
+ }
+ }
+ $summary = $parser->getSummary();
+ $this->view->resultSummary = $summary;
+ } else {
+ // process one query
+ try {
+ $res = $this->_db->query($statements[0], Msd_Db::ARRAY_ASSOC);
+ print_r($res);
+ $this->view->resultset = $res;
+ } catch (Exception $e) {
+ $this->view->errorMessage = $e->getMessage();
+ }
}
}
}
diff --git a/application/views/scripts/sql/sqlbox/sqlbox.phtml b/application/views/scripts/sql/sqlbox/sqlbox.phtml
index 2313a00..6e1300e 100644
--- a/application/views/scripts/sql/sqlbox/sqlbox.phtml
+++ b/application/views/scripts/sql/sqlbox/sqlbox.phtml
@@ -50,7 +50,7 @@ function setShowTableQuery()
jQuery()->javascriptCaptureEnd();
-if (isset($this->resultset)) {
+if (isset($this->resultset) && is_array($this->resultset)) {
$res = $this->resultset;
if (count($res)>0) {
$fieldNames = array_keys($res[0]);
@@ -85,11 +85,42 @@ if (isset($this->resultset)) {
?>
' . $this->lang->L_NO_ENTRIES . '
lang->L_RESULT;?>: | +||
---|---|---|
# | +lang->L_QUERY_TYPE;?> | +lang->L_NR_OF_QUERIES;?> | +
numberFormat($i);?>. | ++ | numberFormat($count);?> | +
+ | lang->L_SUM_TOTAL;;?> | +numberFormat($totalQueries);?> | +