Fix undefined index.

This commit is contained in:
Michal Čihař
2004-10-19 12:50:30 +00:00
parent f3b5c67cbd
commit f09d9c1aef
2 changed files with 7 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ $Source$
2004-10-19 Michal Čihař <michal@cihar.com> 2004-10-19 Michal Čihař <michal@cihar.com>
* export.php: Use just \n for SQL exports (bug #1042521). * export.php: Use just \n for SQL exports (bug #1042521).
* libraries/read_dump.lib.php: Set correct return value (bug #1048861). * libraries/read_dump.lib.php: Set correct return value (bug #1048861).
* sql.php: Fix undefined index.
2004-10-17 Marc Delisle <lem9@users.sourceforge.net> 2004-10-17 Marc Delisle <lem9@users.sourceforge.net>
* lang/turkish update, thanks to boralioglu. * lang/turkish update, thanks to boralioglu.

12
sql.php
View File

@@ -208,7 +208,7 @@ if ($do_confirm) {
if($cfg['ErrorIconic']){ if($cfg['ErrorIconic']){
echo ' <img src="' .$pmaThemeImage .'s_warn.png" border="0" hspace="2" vspace="2" align="left" />'; echo ' <img src="' .$pmaThemeImage .'s_warn.png" border="0" hspace="2" vspace="2" align="left" />';
} }
echo $strDropDatabaseStrongWarning . '&nbsp;<br />' . "\n"; echo $strDropDatabaseStrongWarning . '&nbsp;<br />' . "\n";
} else { } else {
echo ' <tr>' . "\n" echo ' <tr>' . "\n"
. ' <td class="tblHeadError">' . "\n"; . ' <td class="tblHeadError">' . "\n";
@@ -527,14 +527,14 @@ else {
} else { } else {
PMA_DBI_try_query($count_query); PMA_DBI_try_query($count_query);
// if (mysql_error()) { // if (mysql_error()) {
// void. // void.
// I tried the case // I tried the case
// (SELECT `User`, `Host`, `Db`, `Select_priv` FROM `db`) // (SELECT `User`, `Host`, `Db`, `Select_priv` FROM `db`)
// UNION (SELECT `User`, `Host`, "%" AS "Db", // UNION (SELECT `User`, `Host`, "%" AS "Db",
// `Select_priv` // `Select_priv`
// FROM `user`) ORDER BY `User`, `Host`, `Db`; // FROM `user`) ORDER BY `User`, `Host`, `Db`;
// and although the generated count_query is wrong // and although the generated count_query is wrong
// the SELECT FOUND_ROWS() work! (maybe it gets the // the SELECT FOUND_ROWS() work! (maybe it gets the
// count from the latest query that worked) // count from the latest query that worked)
// //
// another case where the count_query is wrong: // another case where the count_query is wrong:
@@ -750,7 +750,7 @@ else {
echo ' <!-- Print view -->' . "\n" echo ' <!-- Print view -->' . "\n"
. ' <a href="sql.php' . $url_query . ' <a href="sql.php' . $url_query
. ((isset($dontlimitchars) && $dontlimitchars == '1') ? '&amp;dontlimitchars=1' : '') . ((isset($dontlimitchars) && $dontlimitchars == '1') ? '&amp;dontlimitchars=1' : '')
. '" target="print_view">' . '" target="print_view">'
. ($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 'b_print.png" border="0" height="16" width="16" align="middle" hspace="2" alt="' . $strPrintView . '"/>' : '') . ($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 'b_print.png" border="0" height="16" width="16" align="middle" hspace="2" alt="' . $strPrintView . '"/>' : '')
. $strPrintView . '</a>' . "\n"; . $strPrintView . '</a>' . "\n";
if (!$dontlimitchars) { if (!$dontlimitchars) {
@@ -770,7 +770,7 @@ else {
// (the url_query has extra parameters that won't be used to export) // (the url_query has extra parameters that won't be used to export)
// (the single_table parameter is used in display_export.lib.php // (the single_table parameter is used in display_export.lib.php
// to hide the SQL and the structure export dialogs) // to hide the SQL and the structure export dialogs)
if ($analyzed_sql[0]['querytype'] == 'SELECT' && !isset($printview)) { if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT' && !isset($printview)) {
if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name']) && !isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) { if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name']) && !isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])) {
$single_table = '&amp;single_table=true'; $single_table = '&amp;single_table=true';
} else { } else {
@@ -780,7 +780,7 @@ else {
. ' &nbsp;&nbsp;<a href="tbl_properties_export.php' . $url_query . ' &nbsp;&nbsp;<a href="tbl_properties_export.php' . $url_query
. '&amp;unlim_num_rows=' . $unlim_num_rows . '&amp;unlim_num_rows=' . $unlim_num_rows
. $single_table . $single_table
. '">' . '">'
. ($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 'b_tblexport.png" border="0" height="16" width="16" align="middle" hspace="2" alt="' . $strExport . '" />' : '') . ($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 'b_tblexport.png" border="0" height="16" width="16" align="middle" hspace="2" alt="' . $strExport . '" />' : '')
. $strExport . '</a>' . "\n"; . $strExport . '</a>' . "\n";
} }