$dbhost = "localhost"; $dbusername = "v106646"; $dbpassword = "9qv0q3p9"; $dbdatabase = "v106646"; $connect = mysql_connect($dbhost,$dbusername,$dbpassword); mysql_select_db($dbdatabase,$connect); if($type=="add") { if($player == "") { print("&error=1&loaded=1&message=Player name must be entered!"); } else { $query = "INSERT INTO charasgame2_score VALUES ('','$score','$player','$location')"; mysql_query ($query,$connect) or die ("&error=1&loaded=1&message=Error connecting to database!"); print("&loaded=1&message=Player added successfully!"); } } else if($type=="view") { if($location) { $query = "SELECT * FROM charasgame2_score where location='$location' order by score desc limit 10"; } else { $query = "SELECT * FROM charasgame2_score order by score desc limit 10"; } $result = mysql_query ($query,$connect) or die ("&error=1&loaded=1&message=Error connecting to database!"); print("&loaded=1"); $followup = 1; while($row = mysql_fetch_array($result)) { print("&name".$followup."=".$row[player]."&score$followup=".$row[score]); $followup++; } } else { if($location) { $query = "SELECT * FROM charasgame2_score where location='$location' order by score desc"; } else { $query = "SELECT * FROM charasgame2_score order by score desc"; } $result = mysql_query ($query,$connect) or die ("Error connecting to database!"); $followup=1; echo "
Number | Name | Score | Location |
$followup | ".$row[player]." | ".$row[score]." | ".$row[location]." |
"; if($location) echo "VIEW SCORE FROM ALL SITES!\n
"; echo "Charas Breakout: BITMAPS ARE EFIL! made by GaryCXJk"; } ?>