3 // vim: expandtab sw=4 ts=4 sts=4:
6 * Gets some core libraries
8 require('./libraries/grab_globals.lib.php3');
9 require('./libraries/common.lib.php3');
12 * Defines the url to return to in case of error in a sql statement
16 $is_gotofile = ereg_replace('^([^?]+).*$', '\\1', $goto);
17 if (!@file_exists
('./' . $is_gotofile)) {
20 $is_gotofile = ($is_gotofile == $goto);
22 } // end if (security checkings)
25 $goto = (empty($table)) ?
$cfg['DefaultTabDatabase'] : $cfg['DefaultTabTable'];
28 if (!isset($err_url)) {
29 $err_url = (!empty($back) ?
$back : $goto)
30 . '?' . PMA_generate_common_url(isset($db) ?
$db : '')
31 . ((strpos(' ' . $goto, 'db_details') != 1 && isset($table)) ?
'&table=' . urlencode($table) : '');
34 // Coming from a bookmark dialog
35 if (isset($fields['query'])) {
36 $sql_query = $fields['query'];
40 * Check rights in case of DROP DATABASE
42 * This test may be bypassed if $is_js_confirmed = 1 (already checked with js)
43 * but since a malicious user may pass this variable by url/form, we don't take
44 * into account this case.
46 if (!defined('PMA_CHK_DROP')
47 && !$cfg['AllowUserDropDatabase']
48 && eregi('DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE[[:space:]]', $sql_query)) {
49 // Checks if the user is a Superuser
50 // TODO: set a global variable with this information
51 // loic1: optimized query
52 $result = @PMA_mysql_query
('USE mysql');
53 if (PMA_mysql_error()) {
54 include('./header.inc.php3');
55 PMA_mysqlDie($strNoDropDatabases, '', '', $err_url);
63 if (isset($store_bkm)) {
64 if (get_magic_quotes_gpc()) {
65 $fields['label'] = stripslashes($fields['label']);
67 include('./libraries/bookmark.lib.php3');
68 PMA_addBookmarks($fields, $cfg['Bookmark']);
69 header('Location: ' . $cfg['PmaAbsoluteUri'] . $goto);
74 * Gets the true sql query
76 // $sql_query has been urlencoded in the confirmation form for drop/delete
77 // queries or in the navigation bar for browsing among records
78 if (isset($btnDrop) ||
isset($navig)) {
79 $sql_query = urldecode($sql_query);
86 $parsed_sql = PMA_SQP_parse((get_magic_quotes_gpc() ?
stripslashes($sql_query) : $sql_query));
87 $analyzed_sql = PMA_SQP_analyze($parsed_sql);
88 // Bug #641765 - Robbat2 - 12 January 2003, 10:49PM
89 // Reverted - Robbat2 - 13 January 2003, 2:40PM
90 $sql_query = PMA_SQP_formatHtml($parsed_sql, 'query_only');
92 // old code did not work, for example, when there is a bracket
94 // so I guess it's ok to check for a real SELECT ... FROM
95 //$is_select = eregi('^SELECT[[:space:]]+', $sql_query);
96 $is_select = isset($analyzed_sql[0]['queryflags']['select_from']);
98 // If the query is a Select, extract the db and table names and modify
99 // $db and $table, to have correct page headers, links and left frame.
100 // db and table name may be enclosed with backquotes, db is optionnal,
101 // query may contain aliases.
103 // (TODO: if there are more than one table name in the Select:
104 // - do not extract the first table name
105 // - do not show a table name in the page header
106 // - do not display the sub-pages links)
110 if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name'])) {
111 $table = $analyzed_sql[0]['table_ref'][0]['table_true_name'];
113 if (isset($analyzed_sql[0]['table_ref'][0]['db'])
114 && !empty($analyzed_sql[0]['table_ref'][0]['db'])) {
115 $db = $analyzed_sql[0]['table_ref'][0]['db'];
120 $reload = ($db == $prev_db) ?
0 : 1;
124 * Sets or modifies the $goto variable if required
126 if ($goto == 'sql.php3') {
128 . PMA_generate_common_url($db, $table)
130 . '&sql_query=' . urlencode($sql_query);
135 * Go back to further page if table should not be dropped
137 if (isset($btnDrop) && $btnDrop == $strNo) {
142 if (strpos(' ' . $goto, 'db_details') == 1 && !empty($table)) {
145 include('./' . ereg_replace('\.\.*', '.', $goto));
147 header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto));
154 * Displays the confirm page if required
156 * This part of the script is bypassed if $is_js_confirmed = 1 (already checked
157 * with js) because possible security issue is not so important here: at most,
158 * the confirm message isn't displayed.
160 * Also bypassed if only showing php code.or validating a SQL query
163 ||
(isset($is_js_confirmed) && $is_js_confirmed)
165 ||
!empty($GLOBALS['show_as_php'])
166 ||
!empty($GLOBALS['validatequery'])) {
169 //$do_confirm = (eregi('DROP[[:space:]]+(IF[[:space:]]+EXISTS[[:space:]]+)?(TABLE|DATABASE[[:space:]])|ALTER[[:space:]]+TABLE[[:space:]]+((`[^`]+`)|([A-Za-z0-9_$]+))[[:space:]]+DROP[[:space:]]|DELETE[[:space:]]+FROM[[:space:]]', $sql_query));
171 $do_confirm = isset($analyzed_sql[0]['queryflags']['need_confirm']);
175 // already stripped at beginning of script
176 //$stripped_sql_query = (get_magic_quotes_gpc() ? stripslashes($sql_query) : $sql_query);
177 $stripped_sql_query = $sql_query;
178 include('./header.inc.php3');
179 echo $strDoYouReally . ' :<br />' . "\n";
180 echo '<tt>' . htmlspecialchars($stripped_sql_query) . '</tt> ?<br/>' . "\n";
182 <form action
="sql.php3" method
="post">
183 <?php
echo PMA_generate_common_hidden_inputs($db, (isset($table)?
$table:'')); ?
>
184 <input type
="hidden" name
="sql_query" value
="<?php echo urlencode(addslashes($sql_query)); ?>" />
185 <input type
="hidden" name
="zero_rows" value
="<?php echo isset($zero_rows) ? $zero_rows : ''; ?>" />
186 <input type
="hidden" name
="goto" value
="<?php echo $goto; ?>" />
187 <input type
="hidden" name
="back" value
="<?php echo isset($back) ? $back : ''; ?>" />
188 <input type
="hidden" name
="reload" value
="<?php echo isset($reload) ? $reload : 0; ?>" />
189 <input type
="hidden" name
="show_query" value
="<?php echo isset($show_query) ? $show_query : ''; ?>" />
190 <input type
="submit" name
="btnDrop" value
="<?php echo $strYes; ?>" />
191 <input type
="submit" name
="btnDrop" value
="<?php echo $strNo; ?>" />
199 * Executes the query and displays results
202 if (!isset($sql_query)) {
205 // already stripped at beginning of script
206 // else if (get_magic_quotes_gpc()) {
207 // $sql_query = stripslashes($sql_query);
209 // Defines some variables
210 // loic1: A table has to be created -> left frame should be reloaded
211 if ((!isset($reload) ||
$reload == 0)
212 && eregi('^CREATE TABLE[[:space:]]+(.*)', $sql_query)) {
215 // Gets the number of rows per page
216 if (!isset($session_max_rows)) {
217 $session_max_rows = $cfg['MaxRows'];
218 } else if ($session_max_rows != 'all') {
219 $cfg['MaxRows'] = $session_max_rows;
221 // Defines the display mode (horizontal/vertical) and header "frequency"
222 if (empty($disp_direction)) {
223 $disp_direction = $cfg['DefaultDisplay'];
225 if (empty($repeat_cells)) {
226 $repeat_cells = $cfg['RepeatCells'];
229 // SK -- Patch: $is_group added for use in calculation of total number of
231 // $is_count is changed for more correct "LIMIT" clause
232 // appending in queries like
233 // "SELECT COUNT(...) FROM ... GROUP BY ..."
234 $is_explain = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = $is_analyse = $is_group = $is_func = FALSE;
235 if ($is_select) { // see line 141
236 $is_group = eregi('[[:space:]]+(GROUP[[:space:]]+BY|HAVING|SELECT[[:space:]]+DISTINCT)[[:space:]]+', $sql_query);
238 $is_func = !$is_group && (eregi('[[:space:]]+(SUM|AVG|STD|STDDEV|MIN|MAX|BIT_OR|BIT_AND)\s*\(', $sql_query));
239 $is_count = !$is_group && (eregi('^SELECT[[:space:]]+COUNT\((.*\.+)?.*\)', $sql_query));
240 $is_export = (eregi('[[:space:]]+INTO[[:space:]]+OUTFILE[[:space:]]+', $sql_query));
241 $is_analyse = (eregi('[[:space:]]+PROCEDURE[[:space:]]+ANALYSE\(', $sql_query));
242 } else if (eregi('^EXPLAIN[[:space:]]+', $sql_query)) {
244 } else if (eregi('^DELETE[[:space:]]+', $sql_query)) {
247 } else if (eregi('^(INSERT|LOAD[[:space:]]+DATA|REPLACE)[[:space:]]+', $sql_query)) {
250 } else if (eregi('^UPDATE[[:space:]]+', $sql_query)) {
252 } else if (eregi('^SHOW[[:space:]]+', $sql_query)) {
254 } else if (eregi('^(CHECK|ANALYZE|REPAIR|OPTIMIZE)[[:space:]]+TABLE[[:space:]]+', $sql_query)) {
258 // Do append a "LIMIT" clause?
260 && (!$cfg['ShowAll'] ||
$session_max_rows != 'all')
261 && !($is_count ||
$is_export ||
$is_func ||
$is_analyse)
262 && isset($analyzed_sql[0]['queryflags']['select_from'])
263 && !eregi('[[:space:]]LIMIT[[:space:]0-9,-]+$', $sql_query)) {
264 $sql_limit_to_append = " LIMIT $pos, ".$cfg['MaxRows'];
265 if (eregi('(.*)([[:space:]](PROCEDURE[[:space:]](.*)|FOR[[:space:]]+UPDATE|LOCK[[:space:]]+IN[[:space:]]+SHARE[[:space:]]+MODE))$', $sql_query, $regs)) {
266 $full_sql_query = $regs[1] . $sql_limit_to_append . $regs[2];
268 $full_sql_query = $sql_query . $sql_limit_to_append;
271 $full_sql_query = $sql_query;
274 PMA_mysql_select_db($db);
276 // If the query is a DELETE query with no WHERE clause, get the number of
277 // rows that will be deleted (mysql_affected_rows will always return 0 in
280 && eregi('^DELETE([[:space:]].+)?([[:space:]]FROM[[:space:]](.+))$', $sql_query, $parts)
281 && !eregi('[[:space:]]WHERE[[:space:]]', $parts[3])) {
282 $cnt_all_result = @PMA_mysql_query
('SELECT COUNT(*) as count' . $parts[2]);
283 if ($cnt_all_result) {
284 $num_rows = PMA_mysql_result($cnt_all_result, 0, 'count');
285 mysql_free_result($cnt_all_result);
291 // E x e c u t e t h e q u e r y
293 // Only if we didn't ask to see the php code (mikebeck)
294 if (!empty($GLOBALS['show_as_php']) ||
!empty($GLOBALS['validatequery'])) {
299 // garvin: Measure query time. TODO-Item http://sourceforge.net/tracker/index.php?func=detail&aid=571934&group_id=23067&atid=377411
300 list($usec, $sec) = explode(' ',microtime());
301 $querytime_before = ((float)$usec +
(float)$sec);
303 $result = @PMA_mysql_query
($full_sql_query);
305 list($usec, $sec) = explode(' ',microtime());
306 $querytime_after = ((float)$usec +
(float)$sec);
308 $GLOBALS['querytime'] = $querytime_after - $querytime_before;
310 // Displays an error message if required and stop parsing the script
311 if (PMA_mysql_error()) {
312 $error = PMA_mysql_error();
313 include('./header.inc.php3');
314 $full_err_url = (ereg('^(db_details|tbl_properties)', $err_url))
315 ?
$err_url . '&show_query=1&sql_query=' . urlencode($sql_query)
317 PMA_mysqlDie($error, $full_sql_query, '', $full_err_url);
320 // Gets the number of rows affected/returned
321 // (This must be done immediately after the query because
322 // mysql_affected_rows() reports about the last query done)
325 $num_rows = ($result) ? @mysql_num_rows
($result) : 0;
326 } else if (!isset($num_rows)) {
327 $num_rows = @mysql_affected_rows
();
330 // Checks if the current database has changed
331 // This could happen if the user sends a query like "USE `database`;"
332 $res = PMA_mysql_query('SELECT DATABASE() AS "db";');
333 $row = PMA_mysql_fetch_array($res);
334 if ($db != $row['db']) {
338 @mysql_free_result
($res);
342 // tmpfile remove after convert encoding appended by Y.Kawada
343 if (function_exists('PMA_kanji_file_conv')
344 && (isset($textfile) && file_exists($textfile))) {
348 // Counts the total number of rows for the same 'SELECT' query without the
349 // 'LIMIT' clause that may have been programatically added
351 if (empty($sql_limit_to_append)) {
352 $unlim_num_rows = $num_rows;
354 else if ($is_select) {
356 // c o u n t q u e r y
358 if (PMA_MYSQL_INT_VERSION
< 40000) {
359 if (eregi('DISTINCT(.*)', $sql_query)) {
360 $count_what = 'DISTINCT ' . $analyzed_sql[0]['select_expr_clause'];
365 $count_query = 'SELECT COUNT(' . $count_what . ') AS count';
368 $count_query = 'SELECT SQL_CALC_FOUND_ROWS ';
371 // add the remaining of select expression if there is
372 // a GROUP BY or HAVING clause
373 if (PMA_MYSQL_INT_VERSION
< 40000
375 && (!empty($analyzed_sql[0]['group_by_clause'])
376 ||
!empty($analyzed_sql[0]['having_clause']))) {
377 $count_query .= ' ,' . $analyzed_sql[0]['select_expr_clause'];
380 // add select expression after the SQL_CALC_FOUND_ROWS
381 if (PMA_MYSQL_INT_VERSION
>= 40000) {
382 $count_query .= $analyzed_sql[0]['select_expr_clause'];
386 if (!empty($analyzed_sql[0]['from_clause'])) {
387 $count_query .= ' FROM ' . $analyzed_sql[0]['from_clause'];
390 if (!empty($analyzed_sql[0]['where_clause'])) {
391 $count_query .= ' WHERE ' . $analyzed_sql[0]['where_clause'];
393 if (!empty($analyzed_sql[0]['group_by_clause'])) {
394 $count_query .= ' GROUP BY ' . $analyzed_sql[0]['group_by_clause'];
397 if (!empty($analyzed_sql[0]['having_clause'])) {
398 $count_query .= ' HAVING ' . $analyzed_sql[0]['having_clause'];
401 // do not put the order_by_clause, it interferes
402 // run the count query
403 if (PMA_MYSQL_INT_VERSION
< 40000) {
404 if ($cnt_all_result = mysql_query($count_query)) {
406 $unlim_num_rows = @mysql_num_rows
($cnt_all_result);
408 $unlim_num_rows = mysql_result($cnt_all_result, 0, 'count');
410 mysql_free_result($cnt_all_result);
413 // there are some cases where the generated
414 // count_query (for MySQL 3) is wrong,
416 //TODO: use a big unlimited query to get
417 // the correct number of rows (depending
418 // on a config variable?)
423 mysql_query($count_query);
425 // void. I tried the case
426 // (SELECT `User`, `Host`, `Db`, `Select_priv` FROM `db`)
427 // UNION (SELECT `User`, `Host`, "%" AS "Db",
429 // FROM `user`) ORDER BY `User`, `Host`, `Db`;
430 // and although the generated count_query is wrong
431 // the SELECT FOUND_ROWS() work!
433 $cnt_all_result = mysql_query('SELECT FOUND_ROWS() as count');
434 $unlim_num_rows = mysql_result($cnt_all_result,0,'count');
437 } else { // not $is_select
439 } // end rows total count
441 // garvin: if a table or database gets dropped, check column comments.
443 include('./libraries/relation.lib.php3');
444 $cfgRelation = PMA_getRelationsParam();
446 if ($cfgRelation['commwork']) {
447 if (isset($table) && isset($db) && !empty($table) && !empty($db)) {
448 $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['column_info'])
449 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
450 . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'';
451 $rmv_rs = PMA_query_as_cu($remove_query);
453 } elseif (isset($db) && !empty($db)) {
454 $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['column_info'])
455 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'';
456 $rmv_rs = PMA_query_as_cu($remove_query);
459 } // end if relation-stuff
461 } // end else "didn't ask to see php code"
464 // No rows returned -> move back to the calling page
465 if ($num_rows < 1 ||
$is_affected) {
467 $message = $strDeletedRows . ' ' . $num_rows;
468 } else if ($is_insert) {
469 $message = $strInsertedRows . ' ' . $num_rows;
470 } else if ($is_affected) {
471 $message = $strAffectedRows . ' ' . $num_rows;
472 } else if (!empty($zero_rows)) {
473 $message = $zero_rows;
474 } else if (!empty($GLOBALS['show_as_php'])) {
476 } else if (!empty($GLOBALS['validatequery'])) {
477 $message = $strValidateSQL;
479 $message = $strEmptyResultSet;
482 $message .= " (" . sprintf($strQueryTime, $GLOBALS['querytime']) . ")";
485 $goto = ereg_replace('\.\.*', '.', $goto);
486 // Checks for a valid target script
487 if (isset($table) && $table == '') {
490 if (isset($db) && $db == '') {
493 $is_db = $is_table = FALSE;
494 if (strpos(' ' . $goto, 'tbl_properties') == 1) {
495 if (!isset($table)) {
496 $goto = 'db_details.php3';
498 $is_table = @PMA_mysql_query
('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'');
499 if (!($is_table && @mysql_numrows
($is_table))) {
500 $goto = 'db_details.php3';
503 } // end if... else...
505 if (strpos(' ' . $goto, 'db_details') == 1) {
512 $is_db = @PMA_mysql_select_db
($db);
517 } // end if... else...
519 // Loads to target script
520 if (strpos(' ' . $goto, 'db_details') == 1
521 ||
strpos(' ' . $goto, 'tbl_properties') == 1) {
522 $js_to_run = 'functions.js';
524 if ($goto != 'main.php3') {
525 include('./header.inc.php3');
527 include('./' . $goto);
528 } // end if file_exist
530 header('Location: ' . $cfg['PmaAbsoluteUri'] . str_replace('&', '&', $goto) . '&message=' . urlencode($message));
533 } // end no rows returned
535 // At least one row is returned -> displays a table with results
537 // Displays the headers
538 if (isset($show_query)) {
541 if (isset($printview) && $printview == '1') {
542 include('./header_printview.inc.php3');
544 $js_to_run = 'functions.js';
546 if (!empty($table)) {
547 include('./tbl_properties_common.php3');
548 $url_query .= '&goto=tbl_properties.php3&back=tbl_properties.php3';
549 include('./tbl_properties_table_info.php3');
552 include('./db_details_common.php3');
553 include('./db_details_db_info.php3');
555 include('./libraries/relation.lib.php3');
556 $cfgRelation = PMA_getRelationsParam();
559 // Gets the list of fields properties
560 if (isset($result) && $result) {
561 while ($field = PMA_mysql_fetch_field($result)) {
562 $fields_meta[] = $field;
564 $fields_cnt = count($fields_meta);
567 // Display previous update query (from tbl_replace)
568 if (isset($disp_query) && $cfg['ShowSQL'] == TRUE) {
569 $tmp_sql_query = $GLOBALS['sql_query'];
570 $tmp_sql_limit_to_append = (isset($GLOBALS['sql_limit_to_append'])?
$GLOBALS['sql_limit_to_append']:'');
571 $GLOBALS['sql_query'] = stripslashes($disp_query);
572 $GLOBALS['sql_limit_to_append'] = '';
573 PMA_showMessage($disp_message);
574 $GLOBALS['sql_query'] = $tmp_sql_query;
575 $GLOBALS['sql_limit_to_append'] = $tmp_sql_limit_to_append;
578 // Displays the results in a table
579 include('./libraries/display_tbl.lib.php3');
580 if (empty($disp_mode)) {
581 // see the "PMA_setDisplayMode()" function in
582 // libraries/display_tbl.lib.php3
583 $disp_mode = 'urdr111101';
585 if (!isset($dontlimitchars)) {
589 PMA_displayTable($result, $disp_mode, $analyzed_sql);
590 mysql_free_result($result);
592 if ($disp_mode[6] == '1' ||
$disp_mode[9] == '1') {
596 // Displays "Insert a new row" link if required
597 if ($disp_mode[6] == '1') {
598 $lnk_goto = 'sql.php3?'
599 . PMA_generate_common_url($db, $table)
601 . '&session_max_rows=' . $session_max_rows
602 . '&disp_direction=' . $disp_direction
603 . '&repeat_cells=' . $repeat_cells
604 . '&dontlimitchars=' . $dontlimitchars
605 . '&sql_query=' . urlencode($sql_query);
607 . PMA_generate_common_url($db, $table)
609 . '&session_max_rows=' . $session_max_rows
610 . '&disp_direction=' . $disp_direction
611 . '&repeat_cells=' . $repeat_cells
612 . '&dontlimitchars=' . $dontlimitchars
613 . '&sql_query=' . urlencode($sql_query)
614 . '&goto=' . urlencode($lnk_goto);
616 echo ' <!-- Insert a new row -->' . "\n"
617 . ' <a href="tbl_change.php3' . $url_query . '">' . $strInsertNewRow . '</a>';
618 if ($disp_mode[9] == '1') {
622 } // end insert new row
624 // Displays "printable view" link if required
625 if ($disp_mode[9] == '1') {
627 . PMA_generate_common_url($db, $table)
629 . '&session_max_rows=' . $session_max_rows
630 . '&disp_direction=' . $disp_direction
631 . '&repeat_cells=' . $repeat_cells
633 . ((isset($dontlimitchars) && $dontlimitchars == '1') ?
'&dontlimitchars=1' : '')
634 . '&sql_query=' . urlencode($sql_query);
635 echo ' <!-- Print view -->' . "\n"
636 . ' <a href="sql.php3' . $url_query . '" target="print_view">' . $strPrintView . '</a>' . "\n";
637 } // end displays "printable view"
642 // Export link, if only one table
643 // (the url_query has extra parameters that won't be used to export)
644 if (!isset($printview)
645 && isset($analyzed_sql[0]['table_ref'][0]['table_true_name'])
646 && !isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) {
647 echo ' <!-- Export -->' . "\n"
648 . ' <a href="tbl_properties_export.php3' . $url_query . '&unlim_num_rows=' . $unlim_num_rows . '">' . $strExport . '</a>' . "\n";
651 // Bookmark Support if required
652 if ($disp_mode[7] == '1'
653 && ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table'] && empty($id_bookmark))
654 && !empty($sql_query)) {
658 . PMA_generate_common_url($db, $table)
660 . '&session_max_rows=' . $session_max_rows
661 . '&disp_direction=' . $disp_direction
662 . '&repeat_cells=' . $repeat_cells
663 . '&dontlimitchars=' . $dontlimitchars
664 . '&sql_query=' . urlencode($sql_query)
665 . '&id_bookmark=1';
667 <!-- Bookmark the query
-->
668 <form action
="sql.php3" method
="post" onsubmit
="return emptyFormElements(this, 'fields[label]');">
671 if ($disp_mode[3] == '1') {
672 echo ' <i>' . $strOr . '</i>' . "\n";
676 <?php
echo $strBookmarkLabel; ?
> 
;:
677 <?php
echo PMA_generate_common_hidden_inputs(); ?
>
678 <input type
="hidden" name
="goto" value
="<?php echo $goto; ?>" />
679 <input type
="hidden" name
="fields[dbase]" value
="<?php echo htmlspecialchars($db); ?>" />
680 <input type
="hidden" name
="fields[user]" value
="<?php echo $cfg['Bookmark']['user']; ?>" />
681 <input type
="hidden" name
="fields[query]" value
="<?php echo urlencode($sql_query); ?>" />
682 <input type
="text" name
="fields[label]" value
="" />
683 <input type
="submit" name
="store_bkm" value
="<?php echo $strBookmarkThis; ?>" />
686 } // end bookmark support
688 // Do print the page if required
689 if (isset($printview) && $printview == '1') {
692 <script type
="text/javascript" language
="javascript1.2">
695 if (typeof(window
.print) != 'undefined') {
702 } // end rows returned
704 } // end executes the query
709 * Displays the footer
711 require('./footer.inc.php3');