* Fixed an error when $cfg['Server']['table_info'] is not valid;

* Removed an "onchange" js handler to lower server charge.
This commit is contained in:
Loïc Chapeaux
2002-05-25 09:53:13 +00:00
parent ddd8747429
commit 9609d89829
2 changed files with 31 additions and 25 deletions

View File

@@ -10,6 +10,9 @@ $Source$
standards.
* lang/english.inc.php3; lang/french.inc.php3: sorted.
* header.inc.php3: enforce relative url in CSS.
* tbl_relation.php3:
- fixed an error when $cfg['Server']['table_info'] is not valid;
- removed an "onchange" js handler to lower server charge.
2002-05-25 Alexander M. Turek <rabus@users.sourceforge.net>
* lang/italian.inc.php3: Updates, thanks again to

View File

@@ -148,7 +148,7 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
<th><?php echo $row[0]; ?></th>
<td>
<input type="hidden" name="src_field" value="<?php echo $row['Field']; ?>" />
<select name="destination[<?php echo htmlspecialchars($row['Field']); ?>]" onchange="this.form.submit(); ">
<select name="destination[<?php echo htmlspecialchars($row['Field']); ?>]">
<?php
echo "\n";
reset($selectboxall);
@@ -160,7 +160,7 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
echo ' selected="selected"';
}
echo '>' . $value . '</option>'. "\n";
}
} // end while
?>
</select>
</td>
@@ -181,20 +181,7 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
} // end if
if (!empty($cfg['Server']['table_info'])) {
echo "\n";
?>
<form method="post" action="tbl_relation.php3">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="submit_show" value="true" />
<p><?php echo $strChangeDisplay; ?></P>
<select name="display_field" onchange="this.form.submit(); ">
<?php
echo "\n";
// Get "display_filed" infos
$disp_query = 'SELECT display_field FROM ' . PMA_backquote($cfg['Server']['table_info'])
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table) . '\'';
$disp_rs = mysql_query($disp_query) or PMA_mysqlDie('', $disp_query, '', $err_url_0);
@@ -204,6 +191,21 @@ if (!empty($cfg['Server']['table_info'])) {
}
$col_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table);
$col_rs = mysql_query($col_query) or PMA_mysqlDie('', $col_query, '', $err_url_0);
if ($col_rs && mysql_num_rows($col_rs) > 0) {
echo "\n";
?>
<form method="post" action="tbl_relation.php3" onchange="this.form.submit();">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="submit_show" value="true" />
<p><?php echo $strChangeDisplay; ?></P>
<select name="display_field">
<?php
echo "\n";
while ($row = @mysql_fetch_array($col_rs)) {
echo ' <option value="' . htmlspecialchars($row['Field']) . '"';
if (isset($disp) && $row['Field'] == $disp) {
@@ -217,6 +219,7 @@ if (!empty($cfg['Server']['table_info'])) {
</form>
<?php
} // end if
} // end if
/**