diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3
index 1b9f77143..50c7c9b91 100644
--- a/libraries/display_tbl.lib.php3
+++ b/libraries/display_tbl.lib.php3
@@ -568,8 +568,11 @@ if (!defined('__LIB_DISPLAY_TBL__')){
// table being displayed has one or more keys; but to display
// delete/edit options correctly for tables without keys.
- while ($row = mysql_fetch_row($dt_result)) {
- $bgcolor = ($foo % 2) ? $GLOBALS['cfgBgcolorOne'] : $GLOBALS['cfgBgcolorTwo'];
+ // loic1: use 'mysql_fetch_array' rather than 'mysql_fetch_row' to get
+ // the NULL values
+
+ while ($row = mysql_fetch_array($dt_result)) {
+ $bgcolor = ($foo % 2) ? $GLOBALS['cfgBgcolorOne'] : $GLOBALS['cfgBgcolorTwo'];
?>
@@ -587,11 +590,10 @@ if (!defined('__LIB_DISPLAY_TBL__')){
for ($i = 0; $i < $fields_cnt; ++$i) {
$primary = $fields_meta[$i];
$condition = ' ' . backquote($primary->name) . ' ';
- if (!isset($row[$i])) {
- $row[$i] = '';
+ if (!isset($row[$primary->name])) {
$condition .= 'IS NULL AND';
} else {
- $condition .= '= \'' . sql_addslashes($row[$i]) . '\' AND';
+ $condition .= '= \'' . sql_addslashes($row[$primary->name]) . '\' AND';
}
if ($primary->primary_key > 0) {
$primary_key .= $condition;
@@ -610,12 +612,6 @@ if (!defined('__LIB_DISPLAY_TBL__')){
$uva_condition = urlencode(ereg_replace(' ?AND$', '', $uva_condition));
} // end if (1.1)
- // 1.2 Results from a "SHOW PROCESSLIST" statement -> gets the
- // process id
- else if ($is_display['del_lnk'] == 'kp') {
- $pma_pid = $row[0];
- }
-
// 1.2 Defines the urls for the modify/delete link(s)
$url_query = 'lang=' . $lang
. '&server=' . $server
@@ -662,13 +658,13 @@ if (!defined('__LIB_DISPLAY_TBL__')){
. '?lang=' . $lang
. '&server=' . $server
. '&db=mysql'
- . '&sql_query=' . urlencode('KILL ' . $pma_pid)
+ . '&sql_query=' . urlencode('KILL ' . $row['Id'])
. '&goto=main.php3';
- $js_conf = 'KILL ' . $pma_pid;
+ $js_conf = 'KILL ' . $row['Id'];
$del_str = $GLOBALS['strKill'];
- } // end if (1.2.1)
+ } // end if (1.2.2)
- // 1.2.3 Displays the links at left if required
+ // 1.3 Displays the links at left if required
if ($GLOBALS['cfgModifyDeleteAtLeft']) {
if (!empty($edit_url)) {
?>
@@ -688,19 +684,18 @@ if (!defined('__LIB_DISPLAY_TBL__')){
numeric == 1) {
- if ($row[$i] != '') {
- echo '
' . $row[$i] . '
' . "\n";
+ if (!isset($row[$primary->name])) {
+ echo '
NULL
' . "\n";
+ } else if ($row[$i] != '') {
+ echo '
' . $row[$primary->name] . '
' . "\n";
} else {
echo '
' . "\n";
}
@@ -713,28 +708,32 @@ if (!defined('__LIB_DISPLAY_TBL__')){
if (eregi('BINARY', $field_flags)) {
echo '