diff --git a/ChangeLog b/ChangeLog index d00140604..6d317e1a1 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,8 +5,13 @@ phpMyAdmin - Changelog $Id$ $Source$ +2001-05-28 Loïc Chapeaux + * lib.inc.php3, line 5: fixed a warning + * lib.inc.php3, main.php3, sql.php3, tbl_properties: options displayed with + the results of a query depends now on its type (bug #425888) + 2001-05-27 Marc Delisle - * bug #426357: mysql_db_query deprecated + * bug #426357: mysql_db_query deprecated 2001-05-24 Loïc Chapeaux * lib.inc.php3, line 131+: fixed the authentification failure with advanced diff --git a/lib.inc.php3 b/lib.inc.php3 index 0e39f460b..44f9c597b 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -2,7 +2,9 @@ /* $Id$ */ require("./config.inc.php3"); -mysql_select_db($db); +if (isset($db)) { + mysql_select_db($db); +} if(!defined("__LIB_INC__")) { define("__LIB_INC__", 1); @@ -285,7 +287,7 @@ if($server == 0) { // ----------------------------------------------------------------- -function display_table ($dt_result) { +function display_table ($dt_result, $is_simple = false) { global $cfgBorder, $cfgBgcolorOne, $cfgBgcolorTwo, $cfgMaxRows, $pos; global $server, $lang, $db, $table, $sql_query, $sql_order, $cfgOrder, $cfgShowBlob; global $goto, $strShowingRecords, $strSelectNumRows, $SelectNumRows; @@ -299,20 +301,22 @@ function display_table ($dt_result) { load_javascript(); $primary = false; - if(!empty($table) && !empty($db)) { + if(!$is_simple && !empty($table) && !empty($db)) { $result = mysql_query("SELECT COUNT(*) as total FROM $db.$table") or mysql_die(); $row = mysql_fetch_array($result); $total = $row["total"]; } - if(!isset($pos)) - $pos = 0; - $pos_next = $pos + $cfgMaxRows; - $pos_prev = $pos - $cfgMaxRows; - - if ($pos_prev < 0) { - $pos_prev = 0; - } + if (!$is_simple) { + if(!isset($pos)) { + $pos = 0; + } + $pos_next = $pos + $cfgMaxRows; + $pos_prev = $pos - $cfgMaxRows; + if ($pos_prev < 0) { + $pos_prev = 0; + } + } if(isset($total) && $total>1) { if(isset($SelectNumRows) && $SelectNumRows!=$total) @@ -332,26 +336,28 @@ function display_table ($dt_result) { $field = mysql_fetch_field($dt_result); $table = $field->table; mysql_field_seek($dt_result, 0); - show_table_navigation($pos_next, $pos_prev, $dt_result); + if (!$is_simple) { + show_table_navigation($pos_next, $pos_prev, $dt_result); + } else { + echo '

'; + } ?> \n"; } while($field = mysql_fetch_field($dt_result)) { - if(@mysql_num_rows($dt_result)>1) + if(@mysql_num_rows($dt_result)>1 && !$is_simple) { $sort_order=urlencode(" order by $field->name $cfgOrder"); echo "\n"; } @@ -423,7 +429,7 @@ function display_table ($dt_result) { $delete_url .= "?sql_query=".urlencode("DELETE FROM $table WHERE ").$uva_condition; $delete_url .= "&$query"; $delete_url .= "&goto=sql.php3".urlencode("?$query&goto=tbl_properties.php3&sql_query=".urlencode($sql_query)."&zero_rows=".urlencode($strDeleted)); - if($cfgModifyDeleteAtLeft) { + if($cfgModifyDeleteAtLeft && !$is_simple) { echo ""; echo ""; } @@ -447,7 +453,7 @@ function display_table ($dt_result) { echo "\n"; } } - if($cfgModifyDeleteAtRight) { + if($cfgModifyDeleteAtRight && !$is_simple) { echo ""; echo ""; } @@ -457,7 +463,9 @@ function display_table ($dt_result) { } echo "
"; - if(!eregi("SHOW VARIABLES|SHOW PROCESSLIST|SHOW STATUS", $sql_query)) echo ""; - echo $field->name; - if(!eregi("SHOW VARIABLES|SHOW PROCESSLIST|SHOW STATUS", $sql_query)) + echo $field->name; echo ""; echo "".$strEdit."".$strDelete." ".htmlspecialchars($row[$i])." ".$strEdit."".$strDelete."
\n"; - show_table_navigation($pos_next, $pos_prev, $dt_result); + if (!$is_simple) { + show_table_navigation($pos_next, $pos_prev, $dt_result); + } }//display_table // Return $table's CREATE definition diff --git a/main.php3 b/main.php3 index f55aa7a8e..896a2da5e 100755 --- a/main.php3 +++ b/main.php3 @@ -112,16 +112,16 @@ if($server > 0) { if($result_usr['References_priv']=='Y') { ?> -
  • "> +
  • &display=simple"> -
  • "> +
  • &display=simple"> -
  • "> +
  • &display=simple"> $strInsertNewRow

    "; + if ($display != 'bkmOnly') { + echo "

    $strInsertNewRow

    "; + } // Bookmark Support if($cfgBookmark['db'] && $cfgBookmark['table'] && $db!=$cfgBookmark['db'] && empty($id_bookmark)) { echo "
    \n"; - echo "$strOr

    \n"; + if ($display != 'bkmOnly') { + echo "$strOr"; + } + echo "

    \n"; echo $strBookmarkLabel.":\n"; $goto="sql.php3?server=$server&lang=$lang&db=$db&table=$table&pos=$pos&id_bookmark=1&sql_query=".urlencode($sql_query); ?> diff --git a/tbl_properties.php3 b/tbl_properties.php3 index 8068ccad1..c34a07c2a 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -230,10 +230,10 @@ if($cfgBookmark['db'] && $cfgBookmark['table'])
  • &pos=0&">
  • -
  • &pos=0&"> 
  • -
  • &pos=0&"> 
  • -
  • &pos=0&"> 
  • -
  • &pos=0&"> 
  • +
  • &display=bkmOnly&"> 
  • +
  • &display=bkmOnly&"> 
  • +
  • &display=bkmOnly&"> 
  • +
  • &display=bkmOnly&">