<?php
//Hier einfach deine Daten eingeben:
$host = '
localhost';
$name = 'username';
$passwort = 'deinpasswort';
$datenbank = 'NameDerDatenbank';
//ab hier einfach nix mehr ändern
$user = $_GET['user'];
$score = $_GET['score'];
$db_link = @mysql_connect('$host', '$name', '$passwort');
if($db_link) {
echo "
Zu Server verbunden.</p>
";
};
if(mysql_select_db('$datenbank')) {
echo "
Datenbank ausgewählt.</p>
";
};
if ($user == '') {
$
sql = "SELECT user,score FROM score ORDER BY score DESC";
$result = mysql_query($
sql) OR die(mysql_error());
echo "<table border=\"1\">";
while($row = mysql_fetch_assoc($result)) {
echo "<tr><td>".$row['user']."</td><td>".$row['score']."</td></tr>";
};
echo "</table>";
} else {
$
sql = "SELECT user FROM score";
if ($
sql) {
mysql_query ("UPDATE score (user,score) VALUES ('$user','$score')") or die (mysql_error());
} else {
mysql_query ("INSERT INTO score (user,score) VALUES ('$user','$score')") or die (mysql_error());
echo "
Eintrag gespeichert!</p>";
};
};
?>