bug 648263

This commit is contained in:
Marc Delisle
2002-12-18 13:26:13 +00:00
parent 47c18858a4
commit 193e9aa188
2 changed files with 8 additions and 1 deletions

View File

@@ -149,9 +149,13 @@ if (!isset($param) || $param[0] == '') {
include('./libraries/get_foreign.lib.php3');
echo "\n";
if ($foreigners && isset($foreigners[$field]) && isset($disp) && $disp) {
// we got a bug report: in some cases, even if $disp is true,
// there are no rows, so we add a fetch_array
if ($foreigners && isset($foreigners[$field]) && isset($disp) && $disp && @PMA_mysql_fetch_array($disp)) {
echo ' <select name="fields[]">' . "\n";
echo ' <option value=""></option>' . "\n";
// go back to first row
mysql_data_seek($disp,0);
while ($relrow = @PMA_mysql_fetch_array($disp)) {
$key = $relrow[$foreign_field];
$value = (($foreign_display != FALSE) ? '-' . htmlspecialchars($relrow[$foreign_display]) : '');