From 54a30da6116951a8089344a983541f6b49e7f6c3 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 22 Nov 2002 18:26:58 +0000 Subject: [PATCH] numeric foreign keys --- ChangeLog | 3 +++ libraries/display_tbl.lib.php3 | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index e9b15927b..a719dfc1c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-11-22 Marc Delisle + * libraries/display_tbl.lib.php3: numeric foreign keys used as alias + 2002-11-22 Alexander M. Turek * scripts/create-release.sh: The script should now work at the SF shell again. diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index 0d6457968..28472a424 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -1042,6 +1042,17 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { } else if ($row[$pointer] != '') { $vertical_display['data'][$row_no][$i] = ' '; + reset($analyzed_sql[0]['select_expr']); + while (list ($select_expr_position, $select_expr) = each ($analyzed_sql[0]['select_expr'])) { + $alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias']; + if (!empty($alias)) { + $true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column']; + if ($alias == $meta->name) { + $meta->name = $true_column; + } // end if + } // end if + } // end while + if (isset($map[$meta->name])) { // Field to display from the foreign table? if (!empty($map[$meta->name][2])) {