From e0fec054069c90640da2f4dce874bf4ac329a1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Sun, 2 Sep 2001 18:42:15 +0000 Subject: [PATCH] fixed bug #444767 - Other cases for display=simple --- sql.php3 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sql.php3 b/sql.php3 index 5bad040f7..710e07f82 100755 --- a/sql.php3 +++ b/sql.php3 @@ -110,15 +110,15 @@ if ($do_confirm) { } include('./header.inc.php3'); echo $strDoYouReally . ' :
' . "\n"; - echo '' . htmlspecialchars($stripped_sql_query) . ' ?
'; + echo '' . htmlspecialchars($stripped_sql_query) . ' ?
' . "\n"; ?>
- - + - + + @@ -293,14 +293,16 @@ else { } } - // Gets the list of fields properties + // Gets the list of fields properties while ($field = mysql_fetch_field($result)) { $fields_meta[] = $field; } $fields_cnt = count($fields_meta); - // Defines wether to display the full/partial text button or not + // Defines wether to display the full/partial text button or and + // refines the display mode if required $show_text_btn = FALSE; + $prev_table = $fields_meta[0]->table; for ($i = 0; $i < $fields_cnt; $i++) { if (eregi('BLOB', $fields_meta[$i]->type)) { $show_text_btn = TRUE; @@ -310,11 +312,14 @@ else { } // loic1: maybe the fix for the second alias bug? if (($display != 'simple' && $display != 'bkmOnly') - && $fields_meta[$i]->table == '') { + && ($fields_meta[$i]->table == ''|| $fields_meta[$i]->table != $prev_table)) { $display = 'simple'; + if ($show_text_btn) { + break; + } } + $prev_table = $fields_meta[$i]->table; } // end while - mysql_field_seek($result, 0); // Displays the results in a table display_table($result, ($display == 'simple' || $display == 'bkmOnly'), $show_text_btn);