Skip to content

Commit f25809a

Browse files
committed
bugfixes with sorting and pagination
1 parent 34dea8d commit f25809a

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

Docs/changelog.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ version 3.7
44
Updates:
55

66
Bufixes:
7-
- fixes issues starting up MyWebSQL when running php as FCGi in nginx server
7+
- problems with php running as FCGi in nginx server
88
- corrupt output on some php configuration, mainly due to incompatible settings
9-
- list of table was not displayed for PostgreSQL databases when import a single table data from csv files
9+
- list of table not displayed for PostgreSQL databases when importing a single table data from csv files
1010
- on some php configurations, database selection did not work due to cookies and request variables being merged
1111
- insert queries generated for some Pgsql databases failed to execute due to syntax errors
1212
- fixed data table import bug with pgsql databases, generating incorrect queries with table namespaces
13+
- fixed sorting and pagination issues with query data (thanks to Peng Xiao for valuable feedback)
1314
General:
1415
- added compatibility to PHP 5.2 after user requests
1516

js/query.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,11 @@ function setupResults() {
498498
}
499499

500500
function goPage(num) {
501-
wrkfrmSubmit("query", "table", num, editTableName);
501+
if(queryType == "table") {
502+
wrkfrmSubmit("query", "table", num, editTableName);
503+
} else {
504+
wrkfrmSubmit("query", "query", num, "");
505+
}
502506
}
503507

504508
function goSort(field) {

lib/util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,11 @@ function createResultGrid(&$db)
263263
$js .= "parent.totalRecords = $total_records;\n";
264264
$js .= "parent.totalPages = $total_pages;\n";
265265
$js .= "parent.currentPage = $current_page;\n";
266+
$js .= "parent.queryType = \"".(Session::get('select', 'table') ? 'table' : 'query')."\";\n";
266267
$js .= "parent.transferResultGrid(".$numRows.", '$tm', \"$message\");\n";
267268
$js .= "parent.addCmdHistory(\"".preg_replace("/[\n\r]+/", "<br/>", htmlspecialchars(Session::get('select', 'query')))."\", 1);\n";
268269
$js .= "parent.resetFrame();\n";
269270
$js .= "</script>\n";
270-
271271
print $js;
272272
}
273273

modules/query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function simpleQuery(&$db) {
171171
if ($count > $record_limit) {
172172
Session::set('select', 'count', $count);
173173
Session::set('select', 'page', 1);
174-
Session::set('select', 'limit', true);
174+
Session::set('select', 'limit', 1);
175175
$limit = $db->getLimit( $record_limit );
176176
$query .= $limit;
177177
}

0 commit comments

Comments
 (0)