Previous version were buggy (my fault, sorry)
This commit is contained in:
12
lib.inc.php3
12
lib.inc.php3
@@ -928,7 +928,7 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
||||
} else {
|
||||
$selectstring = '';
|
||||
}
|
||||
$lastShownRec = ($pos_next > $total) ? $total : $pos_next;
|
||||
$lastShownRec = ($pos_next > $total) ? $total : $pos_next;
|
||||
show_message($GLOBALS['strShowingRecords'] . " $pos - $lastShownRec ($total " . $GLOBALS['strTotal'] . $selectstring . ')');
|
||||
} else {
|
||||
show_message($GLOBALS['strSQLQuery']);
|
||||
@@ -940,7 +940,8 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
||||
$table = $field->table;
|
||||
}
|
||||
mysql_field_seek($dt_result, 0);
|
||||
if (!$is_simple) {
|
||||
if (!$is_simple
|
||||
&& (!isset($SelectNumRows) || $SelectNumRows > $GLOBALS['cfgMaxRows'])) {
|
||||
show_table_navigation($pos_next, $pos_prev, $dt_result);
|
||||
} else {
|
||||
echo "\n" . '<br /><br />' . "\n";
|
||||
@@ -1186,12 +1187,15 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
||||
} // end while
|
||||
?>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
<?php
|
||||
echo "\n";
|
||||
if (!$is_simple) {
|
||||
echo '<br />';
|
||||
if (!$is_simple
|
||||
&& (!isset($SelectNumRows) || $SelectNumRows > $GLOBALS['cfgMaxRows'])) {
|
||||
show_table_navigation($pos_next, $pos_prev, $dt_result);
|
||||
} else {
|
||||
echo "\n" . '<br />' . "\n";
|
||||
}
|
||||
} // end of the 'display_table()' function
|
||||
|
||||
|
10
sql.php3
10
sql.php3
@@ -63,6 +63,7 @@ $do_confirm = ($cfgConfirm
|
||||
&& !isset($btnDrop)
|
||||
&& eregi('DROP +(TABLE|DATABASE)|ALTER TABLE +[[:alnum:]_`]* +DROP|DELETE FROM', $sql_query));
|
||||
$is_select = eregi('^SELECT ', $sql_query);
|
||||
$is_count = ($is_select && eregi('^SELECT COUNT\((.*\.+)?\*\) FROM ', $sql_query));
|
||||
$is_delupd = eregi('^(DELETE|UPDATE) ', $sql_query);
|
||||
|
||||
|
||||
@@ -117,7 +118,7 @@ else {
|
||||
$cfgMaxRows = $sessionMaxRows;
|
||||
}
|
||||
$sql_limit_to_append = (isset($pos)
|
||||
&& ($is_select && !eregi('^SELECT COUNT\((.*\.+)?\*\) FROM ', $sql_query))
|
||||
&& ($is_select && !$is_count)
|
||||
&& !eregi(' LIMIT[ 0-9,]+$', $sql_query))
|
||||
? " LIMIT $pos, $cfgMaxRows"
|
||||
: '';
|
||||
@@ -193,6 +194,9 @@ else {
|
||||
}
|
||||
include('./header.inc.php3');
|
||||
// Defines the display mode if it wasn't passed by url
|
||||
if ($is_count) {
|
||||
$display = 'simple';
|
||||
}
|
||||
if (!isset($display)) {
|
||||
$display = eregi('^((SHOW (VARIABLES|PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS))|((CHECK|ANALYZE|REPAIR|OPTIMIZE) TABLE ))', $sql_query, $which);
|
||||
if (!empty($which[2]) && !empty($which[3])) {
|
||||
@@ -201,10 +205,6 @@ else {
|
||||
$display = 'bkmOnly';
|
||||
}
|
||||
}
|
||||
if ($display != 'simple'
|
||||
&& (isset($SelectNumRows) && $SelectNumRows <= $cfgMaxRows)) {
|
||||
$display = 'simple';
|
||||
}
|
||||
|
||||
// Displays the results in a table
|
||||
display_table($result, ($display == 'simple' || $display == 'bkmOnly'));
|
||||
|
Reference in New Issue
Block a user