From 94b3b11ef18da833838e52a7f2e284e88619675f Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Tue, 23 Apr 2002 20:42:13 +0000 Subject: [PATCH] Fixed a bug and some errors --- ChangeLog | 2 ++ tbl_printview.php3 | 28 +++++++++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b8eb0129..1057947f7 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,8 @@ $Source$ 2002-04-23 Alexander M. Turek * libraries/common.lib.php3: fixed bug #547605 using Loïc's patch. + * tbl_printview.php3: Fixed a small bug, some php and XHTML 1.0 errors and + beautified the generated code. 2002-04-22 Loïc Chapeaux * lang/slovak-win1250.inc.php3: completed, thanks to Peter Svec. diff --git a/tbl_printview.php3 b/tbl_printview.php3 index 2a5059f0a..65abc6ed8 100755 --- a/tbl_printview.php3 +++ b/tbl_printview.php3 @@ -149,8 +149,9 @@ while (list($key, $table) = each($the_tables)) { $rel_query = 'SELECT src_column,concat(dest_table,\'->\',dest_column) as rel '; $rel_query .= 'FROM ' . PMA_backquote($cfgServer['relation']); $rel_query .= ' WHERE src_table = \'' . urldecode($table) .'\''; - + $relations = @mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url); + $res_rel = array(); while ($relrow = @mysql_fetch_array($relations)){ $col = $relrow['src_column']; $res_rel[$col]=$relrow['rel']; @@ -160,7 +161,7 @@ while (list($key, $table) = each($the_tables)) { $have_rel=TRUE; }else{ $have_rel=FALSE; - } + } } // @@ -190,7 +191,7 @@ while (list($key, $table) = each($the_tables)) { if($rel_work && $have_rel==TRUE){ echo ''. ucfirst($strLinksTo).''; } - ?> + ?> ' . $field_name . ''; - } echo "\n"; ?> -   + ' . $field_name . ''; + } else { + echo $field_name; + } + ?>  >   @@ -251,11 +255,13 @@ while (list($key, $table) = each($the_tables)) {   -   - '; + if (isset($res_rel[$field_name])) { + echo htmlspecialchars($res_rel[$field_name]); + } + echo ' ' . "\n"; } - ?> + ?>