-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
40 lines (38 loc) · 1.45 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/rating.min.css">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="js/jquery.restable.min.js"></script>
<link rel="stylesheet" href="css/jquery.restable.min.css">
<script>
</script>
</head>
<body>
<?php
include 'conf/db.php';
header('Content-Type: text/html; charset=utf-8');
$sql = "SELECT date, artist, title, album, length FROM playlist ORDER BY date DESC LIMIT 30";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table id=\"responsive-table\" class=\"rwd-table\"><tr><th>Zeit</th><th>Interpret</th><th>Titel</th><th>Album</th><th>Länge</th><th>Bewertung</th></tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["date"]."</td><td>".$row["artist"]."</td><td>".$row["title"]."</td><td>".$row["album"]."</td><td>".$row["length"]."</td><td>".
"<span>☆<span>☆<span>☆<span>☆<span>☆</span></span></span></span></span></td></tr>";
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>
<script src="js/rating.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script>
</script>
</body>
</html>