mardi 22 mars 2016

need updated scoreboard PHP SQL

I need to make a project for school where i have to be able to type in 2 teams(boxers) who are competing with each other and the team(boxer) who wins will rise up in rank on the scoreboard.

Somehow i can only manage to put in the number of wins which decides the rank of the player, but they need to fight each other and the outcome should update the scoreboard.

Its kinda important and deadline is nearing soon so any help is appreciated.

<html>
<head>
<title>Welterweight Pound for Pound Reigning Champions</title>
</head>
<body>
<h1>Welterweight Pound for Pound Reigning Champions</h1>
<form action="display.php" method= "post">
Name of fighter: <input type="text" name="name"><br />

Number of wins: <input type="text" name="wins"><br />

<input type="submit" name="verzenden" >
</form>
<?php
if (isset($_POST['verzenden'])){

$con = mysql_connect("localhost","root","usbw");
if (!$con){
die("Can not connect: " . mysql_error());
}

mysql_select_db("boksen", $con);
$sql = "INSERT INTO fighters (name, wins) VALUES            ('$_POST[name]','$_POST[wins]')";
header("Location: http://localhost:8080/display.php");
mysql_query($sql,$con);
mysql_close($con);
}
?>

Aucun commentaire:

Enregistrer un commentaire