Fixed possible errors with special characters in tables names

This commit is contained in:
Loïc Chapeaux
2002-05-22 20:36:35 +00:00
parent 51d4f8011e
commit f31324fac8

View File

@@ -1365,23 +1365,21 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$result = @mysql_query($local_query); $result = @mysql_query($local_query);
if ($result) { if ($result) {
while ($rel = mysql_fetch_row($result)) { while ($rel = mysql_fetch_row($result)) {
// check for display field?
// check for display field?
if (!empty($cfg['Server']['table_info'])) { if (!empty($cfg['Server']['table_info'])) {
$ti_query = 'SELECT display_field' $ti_query = 'SELECT display_field'
. ' FROM ' . $cfg['Server']['table_info'] . ' FROM ' . PMA_backquote($cfg['Server']['table_info'])
. ' WHERE table_name = \'' . $rel[1] . '\''; . ' WHERE table_name = \'' . PMA_sqlAddslashes($rel[1]) . '\'';
$result_ti = @mysql_query($ti_query); $result_ti = @mysql_query($ti_query);
if ($result_ti) { if ($result_ti) {
list($display_field) = mysql_fetch_row($result_ti); list($display_field) = mysql_fetch_row($result_ti);
} } else {
else {
$display_field = ''; $display_field = '';
} }
} } // end if
$map[$rel[0]] = array($rel[1], $rel[2], $display_field); $map[$rel[0]] = array($rel[1], $rel[2], $display_field);
} } // end while
} } // end if
} // end 2b } // end 2b
// 3. ----- Displays the results table ----- // 3. ----- Displays the results table -----