echo "<thead><tr>";
for ($j=0; $j < count($row); $j++) {
$field = $result->fetch_field();
+ $name = $field->name;
$orgtable = $field->orgtable;
$orgname = $field->orgname;
- if ($orgtable != "") {
+ if ($href) { // MySQL EXPLAIN
+ $links[$j] = ($name == "table" ? "table=" : ($name == "possible_keys" ? "indexes=" : null));
+ } elseif ($orgtable != "") {
if (!isset($indexes[$orgtable])) {
// find primary key in each table
$indexes[$orgtable] = array();
$blobs[$j] = true;
}
$types[$j] = $field->type;
- $name = h($field->name);
+ $name = h($name);
echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . ($href ? "<a href='$href" . strtolower($name) . "' target='_blank' rel='noreferrer'>$name</a>" : $name);
}
echo "</thead>\n";
foreach ($row as $key => $val) {
if (!isset($val)) {
$val = "<i>NULL</i>";
+ } elseif ($blobs[$key] && !is_utf8($val)) {
+ $val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>"; //! link to download
+ } elseif (!strlen($val)) { // strlen - SQLite can return int
+ $val = " "; // some content to print a border
} else {
- if ($blobs[$key] && !is_utf8($val)) {
- $val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>"; //! link to download
- } elseif (!strlen($val)) { // strlen - SQLite can return int
- $val = " "; // some content to print a border
- } else {
- $val = h($val);
- if ($types[$key] == 254) { // 254 - char
- $val = "<code>$val</code>";
- }
+ $val = h($val);
+ if ($types[$key] == 254) { // 254 - char
+ $val = "<code>$val</code>";
}
- if (isset($links[$key]) && !$columns[$links[$key]]) {
+ }
+ if (isset($links[$key]) && !$columns[$links[$key]]) {
+ if ($href) { // MySQL EXPLAIN
+ $link = $links[$key] . urlencode($row[array_search("table=", $links)]);
+ } else {
$link = "edit=" . urlencode($links[$key]);
foreach ($indexes[$links[$key]] as $col => $j) {
$link .= "&where" . urlencode("[" . bracket_escape($col) . "]") . "=" . urlencode($row[$j]);
}
- $val = "<a href='" . h(ME . $link) . "'>$val</a>";
}
+ $val = "<a href='" . h(ME . $link) . "'>$val</a>";
}
echo "<td>$val";
}
Keyboard shortcuts: Alt+Shift+1 for homepage, Ctrl+Shift+Enter for Save and continue edit
Show only errors with Webserver file SQL command
Remember select export and import options
+Link tables and indexes from SQL command EXPLAIN (MySQL)
Display error with all wrong SQL commands (MySQL)
Display foreign keys from other schemas (PostgreSQL)
Pagination support (Oracle)