sub-pages links on browse

This commit is contained in:
Marc Delisle
2002-06-26 18:02:19 +00:00
parent 6bb9a1eee8
commit d05984dde2
3 changed files with 14 additions and 10 deletions

View File

@@ -11,6 +11,7 @@ $Source$
2002-06-26 Marc Delisle <lem9@users.sourceforge.net> 2002-06-26 Marc Delisle <lem9@users.sourceforge.net>
* Documentation.html: update the persons/towns/countries example * Documentation.html: update the persons/towns/countries example
* sql.php3, tbl_properties_table_info.php3: sub-page links on browse
2002-06-26 Olivier L. M<>ller <om@omnis.ch> 2002-06-26 Olivier L. M<>ller <om@omnis.ch>
* tbl_change.php3: display the submit button every 15 lines: * tbl_change.php3: display the submit button every 15 lines:

View File

@@ -1,14 +1,12 @@
<?php <?php
/* $Id$ */ /* $Id$ */
/** /**
* Gets some core libraries * Gets some core libraries
*/ */
require('./libraries/grab_globals.lib.php3'); require('./libraries/grab_globals.lib.php3');
require('./libraries/common.lib.php3'); require('./libraries/common.lib.php3');
/** /**
* Defines the url to return to in case of error in a sql statement * Defines the url to return to in case of error in a sql statement
*/ */
@@ -92,6 +90,11 @@ $sql_query = PMA_sqlFormat($sql_query);
// query may contain aliases. // query may contain aliases.
// (todo: check for embedded comments...) // (todo: check for embedded comments...)
// (todo: if there are more than one table name in the Select:
// - do not extract the first table name
// - do not show a table name in the page header
// - do not display the sub-pages links)
$is_select = eregi('^SELECT[[:space:]]+', $sql_query); $is_select = eregi('^SELECT[[:space:]]+', $sql_query);
if ($is_select) { if ($is_select) {
eregi('^SELECT[[:space:]]+(.*)[[:space:]]+FROM[[:space:]]+(`[^`]+`|[A-Za-z0-9_$]+)([\.]*)(`[^`]*`|[A-Za-z0-9_$]*)', $sql_query, $tmp); eregi('^SELECT[[:space:]]+(.*)[[:space:]]+FROM[[:space:]]+(`[^`]+`|[A-Za-z0-9_$]+)([\.]*)(`[^`]*`|[A-Za-z0-9_$]*)', $sql_query, $tmp);
@@ -107,7 +110,6 @@ if ($is_select) {
} }
} // end if } // end if
/** /**
* Sets or modifies the $goto variable if required * Sets or modifies the $goto variable if required
*/ */
@@ -425,8 +427,9 @@ else {
include('./header_printview.inc.php3'); include('./header_printview.inc.php3');
} else { } else {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
include('./header.inc.php3'); unset($message);
include('./libraries/bookmark.lib.php3'); include('./tbl_properties_common.php3');
include('./tbl_properties_table_info.php3');
include('./libraries/relation.lib.php3'); include('./libraries/relation.lib.php3');
$cfgRelation = PMA_getRelationsParam(); $cfgRelation = PMA_getRelationsParam();
} }

View File

@@ -8,8 +8,8 @@
// The 'show table' statement works correct since 3.23.03 // The 'show table' statement works correct since 3.23.03
if (PMA_MYSQL_INT_VERSION >= 32303) { if (PMA_MYSQL_INT_VERSION >= 32303) {
$local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\''; $local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'';
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0); $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$showtable = PMA_mysql_fetch_array($result); $showtable = PMA_mysql_fetch_array($table_info_result);
$tbl_type = strtoupper($showtable['Type']); $tbl_type = strtoupper($showtable['Type']);
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0); $num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : ''); $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
@@ -27,12 +27,12 @@ if (PMA_MYSQL_INT_VERSION >= 32303) {
unset($tmp); unset($tmp);
} else { } else {
$local_query = 'SELECT COUNT(*) AS count FROM ' . PMA_backquote($table); $local_query = 'SELECT COUNT(*) AS count FROM ' . PMA_backquote($table);
$result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0); $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
$showtable = array(); $showtable = array();
$num_rows = PMA_mysql_result($result, 0, 'count'); $num_rows = PMA_mysql_result($table_info_result, 0, 'count');
$show_comment = ''; $show_comment = '';
} }
mysql_free_result($result); mysql_free_result($table_info_result);
/** /**