fixed a bug when browsing a table with values equal to 0
This commit is contained in:
@@ -22,6 +22,7 @@ $Source$
|
|||||||
whether to display table name or not at the top of the page.
|
whether to display table name or not at the top of the page.
|
||||||
* tbl_copy.php3, line 86: returns to tbl_properties.php3 rather than
|
* tbl_copy.php3, line 86: returns to tbl_properties.php3 rather than
|
||||||
db_details.php3.
|
db_details.php3.
|
||||||
|
* lib.inc.php3: fixed a bug when browsing a table with values equal to 0.
|
||||||
|
|
||||||
2001-08-28 Olivier M<>ller <om@omnis.ch>
|
2001-08-28 Olivier M<>ller <om@omnis.ch>
|
||||||
* db_stats.php3: fixed the sql query so that the script won't die, even if
|
* db_stats.php3: fixed the sql query so that the script won't die, even if
|
||||||
|
15
lib.inc.php3
15
lib.inc.php3
@@ -703,6 +703,10 @@ window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>');
|
|||||||
return array($return_value, $unit);
|
return array($return_value, $unit);
|
||||||
} // end of the 'format_byte_down' function
|
} // end of the 'format_byte_down' function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Functions used to display records returned by a sql query ----- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a navigation bar to browse among the results of a sql query
|
* Displays a navigation bar to browse among the results of a sql query
|
||||||
*
|
*
|
||||||
@@ -1131,10 +1135,10 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
|||||||
}
|
}
|
||||||
$primary = mysql_fetch_field($dt_result, $i);
|
$primary = mysql_fetch_field($dt_result, $i);
|
||||||
if ($primary->numeric == 1) {
|
if ($primary->numeric == 1) {
|
||||||
if (empty($row[$i])) {
|
if ($row[$i] != '') {
|
||||||
echo ' <td align="right"> </td>' . "\n";
|
|
||||||
} else {
|
|
||||||
echo ' <td align="right">' . $row[$i] . '</td>' . "\n";
|
echo ' <td align="right">' . $row[$i] . '</td>' . "\n";
|
||||||
|
} else {
|
||||||
|
echo ' <td align="right"> </td>' . "\n";
|
||||||
}
|
}
|
||||||
} else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $primary->type)) {
|
} else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $primary->type)) {
|
||||||
// loic1 : mysql_fetch_fields returns BLOB in place of TEXT
|
// loic1 : mysql_fetch_fields returns BLOB in place of TEXT
|
||||||
@@ -1151,7 +1155,7 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
|||||||
$row[$i] = substr($row[$i], 0, $GLOBALS['cfgLimitChars']) . '...';
|
$row[$i] = substr($row[$i], 0, $GLOBALS['cfgLimitChars']) . '...';
|
||||||
}
|
}
|
||||||
// loic1 : displays <cr>/<lf>
|
// loic1 : displays <cr>/<lf>
|
||||||
if (!empty($row[$i])) {
|
if ($row[$i] != '') {
|
||||||
$row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$i]));
|
$row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$i]));
|
||||||
echo ' <td>' . $row[$i] . '</td>' . "\n";
|
echo ' <td>' . $row[$i] . '</td>' . "\n";
|
||||||
} else {
|
} else {
|
||||||
@@ -1160,7 +1164,7 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// loic1 : displays <cr>/<lf>
|
// loic1 : displays <cr>/<lf>
|
||||||
if (!empty($row[$i])) {
|
if ($row[$i] != '') {
|
||||||
$row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$i]));
|
$row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$i]));
|
||||||
echo ' <td>' . $row[$i] . '</td>' . "\n";
|
echo ' <td>' . $row[$i] . '</td>' . "\n";
|
||||||
} else {
|
} else {
|
||||||
@@ -1753,7 +1757,6 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
|||||||
// Patch from Chee Wai
|
// Patch from Chee Wai
|
||||||
// (otherwise, if $i == 0 and $sql[$i] == "#", the original order
|
// (otherwise, if $i == 0 and $sql[$i] == "#", the original order
|
||||||
// in the second part of the AND bit will fail with illegal index)
|
// in the second part of the AND bit will fail with illegal index)
|
||||||
// if ($sql[$i] == "#" and ($sql[$i-1] == "\n" or $i==0)) {
|
|
||||||
if ($sql[$i] == '#' && ($i == 0 || $sql[$i-1] == "\n")) {
|
if ($sql[$i] == '#' && ($i == 0 || $sql[$i-1] == "\n")) {
|
||||||
$j = 1;
|
$j = 1;
|
||||||
while ($sql[$i+$j] != "\n") {
|
while ($sql[$i+$j] != "\n") {
|
||||||
|
Reference in New Issue
Block a user