-
Notifications
You must be signed in to change notification settings - Fork 2
/
high.php
35 lines (29 loc) · 939 Bytes
/
high.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
<?php
include("login.inc.php");
// logindaten
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM b_high ORDER BY zeit ASC";
$result=mysql_query($query);
$num=mysql_numrows($result);
if(isset($_GET['AktuellenEintragHighlighten'])) {
$query2="SELECT * FROM b_high ORDER BY id DESC";
$result2=mysql_query($query2);
$aid = mysql_result($result2,0,"id");
}
mysql_close();
echo "<h1>Highscore</h1><table>
<tr><th>platz</th><th>name</th><th>zeit (sekunden)</th></tr>";
$i=0;
while ($i < $num) {
$platz= htmlspecialchars($i+1);
$name=htmlspecialchars(mysql_result($result,$i,"name"));
$zeit=htmlspecialchars(mysql_result($result,$i,"zeit"));
$id=htmlspecialchars(mysql_result($result,$i,"id"));
echo "<tr";
if($aid==$id) {echo " style='background-color:yellow'";}
echo "><td>$platz</td><td>$name</td><td>$zeit</td></tr>";
$i++;
}
echo "</table>";
?>