Permalink
Browse files

Display char type in <code>

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@178 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent fe7d84a commit ae6892d41322f63e68771c10a644783d20775779 jakubvrana committed Jul 15, 2007
Showing with 8 additions and 0 deletions.
  1. +5 −0 functions.inc.php
  2. +3 −0 select.inc.php
View
@@ -212,6 +212,7 @@ function select($result) {
$indexes = array();
$columns = array();
$blobs = array();
+ $types = array();
for ($j=0; $j < count($row); $j++) {
$field = $result->fetch_field();
if (strlen($field->orgtable) && $field->flags & 2) {
@@ -234,6 +235,7 @@ function select($result) {
if ($field->charsetnr == 63) {
$blobs[$j] = true;
}
+ $types[$j] = $field->type;
echo "<th>" . htmlspecialchars($field->name) . "</th>";
}
echo "</tr></thead>\n";
@@ -247,6 +249,9 @@ function select($result) {
$val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>";
} else {
$val = (strlen(trim($val)) ? nl2br(htmlspecialchars($val)) : "&nbsp;");
+ if ($types[$key] == 254) {
+ $val = "<code>$val</code>";
+ }
}
if (isset($links[$key]) && !$columns[$links[$key]]) {
$link = "edit=" . urlencode($links[$key]);
View
@@ -147,6 +147,9 @@ function where_change(op) {
$val = '<a href="' . htmlspecialchars($SELF) . 'download=' . urlencode($_GET["select"]) . '&amp;field=' . urlencode($key) . $unique_idf . '">' . lang('%d byte(s)', strlen($val)) . '</a>';
} else {
$val = (strlen(trim($val)) ? nl2br(htmlspecialchars($val)) : "&nbsp;");
+ if ($fields[$key]["type"] == "char") {
+ $val = "<code>$val</code>";
+ }
foreach ((array) $foreign_keys[$key] as $foreign_key) {
if (count($foreign_keys[$key]) == 1 || count($foreign_key["source"]) == 1) {
$val = '">' . "$val</a>";

0 comments on commit ae6892d

Please sign in to comment.