echo "<textarea name='$name' rows='$rows' cols='$cols' class='sqlarea' spellcheck='false' wrap='off' onkeydown='return textareaKeydown(this, event);'>"; // spellcheck, wrap - not valid before HTML5
if (is_array($value)) {
foreach ($value as $val) { // not implode() to save memory
- echo h($val) . ";\n\n\n"; // rtrim(, ';') would possibly damage DELIMITER
+ echo h($val) . "\n\n\n";
}
} else {
echo h($value);
}
$sql = "";
if ($query) {
- $sql = $adminer->messageQuery($query);
+ $sql = $adminer->messageQuery("$query;");
}
if ($failed) {
$error = error() . $sql;
static $queries = array();
if (!isset($query)) {
// return executed queries without parameter
- return implode("\n", $queries);
+ return implode(";\n", $queries);
}
- $queries[] = (ereg(';$', $query) ? "DELIMITER ;;\n$query;\nDELIMITER ;" : "$query;");
+ $queries[] = (ereg(';$', $query) ? "DELIMITER ;;\n$query;\nDELIMITER " : $query);
return $connection->query($query);
}
if (function_exists('memory_get_usage')) {
@ini_set("memory_limit", 2 * strlen($query) + memory_get_usage() + 8e6); // @ - may be disabled, 2 - substr and trim, 8e6 - other variables
}
- if ($query != "" && strlen($query) < 1e6 && (!$history || end($history) != $query)) { // don't add repeated and big queries
- $history[] = $query;
+ if ($query != "" && strlen($query) < 1e6) { // don't add big queries
+ $q = $query . (ereg(';$', $query) ? "" : ";"); //! doesn't work with DELIMITER |
+ if (!$history || end($history) != $q) { // no repeated queries
+ $history[] = $q;
+ }
}
$space = "(\\s|/\\*.*\\*/|(#|-- )[^\n]*\n|--\n)";
if (!ini_bool("session.use_cookies")) {
Set MySQL time zone by PHP setting
Disable maxlength with functions in edit
Better placement of AJAX icon
+Display ; in history (thanks to Jan Cerny)
Table header in CSV export (Editor)
Time format hint (Editor)
Respect order after search (Editor)