sort only by add date and name

show db size of current db dynamic
This commit is contained in:
Lukas Heiligenbrunner 2020-07-21 23:16:29 +02:00
parent ca499fed99
commit 643c4a872d

View File

@ -14,7 +14,7 @@ if (isset($_POST['action'])) {
$action = $_POST['action']; $action = $_POST['action'];
switch ($action) { switch ($action) {
case "getMovies": case "getMovies":
$query = "SELECT movie_id,movie_name FROM videos ORDER BY likes DESC, create_date DESC, movie_name ASC"; $query = "SELECT movie_id,movie_name FROM videos ORDER BY create_date DESC, movie_name ASC";
if (isset($_POST['tag'])) { if (isset($_POST['tag'])) {
$tag = $_POST['tag']; $tag = $_POST['tag'];
if ($_POST['tag'] != "all") { if ($_POST['tag'] != "all") {
@ -112,10 +112,12 @@ if (isset($_POST['action'])) {
break; break;
case "getDbSize": case "getDbSize":
$dbname = Database::getInstance()->getDatabaseName();
$query = "SELECT table_schema AS \"Database\", $query = "SELECT table_schema AS \"Database\",
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS \"Size\" ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS \"Size\"
FROM information_schema.TABLES FROM information_schema.TABLES
WHERE TABLE_SCHEMA='hub' WHERE TABLE_SCHEMA='$dbname'
GROUP BY table_schema;"; GROUP BY table_schema;";
$result = $conn->query($query); $result = $conn->query($query);