sort also by add date

This commit is contained in:
Lukas Heiligenbrunner 2020-05-24 19:23:00 +02:00
parent eb9a855467
commit e2024e3b11
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ let loadedvideoid = -1;
$(document).ready(function () {
$.post('php/videoload.php', 'action=getMovies', function (data) {
videos = data;
loadPreviewBlock(12);
loadPreviewBlock(15);
}, 'json');
$.post('php/videoload.php', 'action=getDbSize', function (data) {

View File

@ -8,7 +8,7 @@ if (isset($_POST['action'])) {
$action = $_POST['action'];
switch ($action) {
case "getMovies":
$query = "SELECT movie_id,movie_name FROM videos ORDER BY likes DESC,movie_name ASC";
$query = "SELECT movie_id,movie_name FROM videos ORDER BY likes DESC,, create_date ASC, movie_name ASC";
$result = $conn->query($query);
$rows = array();
while ($r = mysqli_fetch_assoc($result)) {