-
Notifications
You must be signed in to change notification settings - Fork 2
/
delay.php
45 lines (33 loc) · 790 Bytes
/
delay.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
41
42
43
44
45
<?php
include_once("config.lib.php");
if(isset($_POST["teamid"])){
//echo "successfully";
$team="team".$_POST["teamid"];
$delay=$_POST["delay"];
$roundno=$_POST["roundno"];
$query ="SELECT * FROM delay WHERE sno=$roundno";
$result=mysqli_query($conn,$query);
$found=mysqli_num_rows($result);
if($found==0)
{ echo "0";
$sql = "INSERT INTO delay ($team) VALUES ($delay)";
if ($conn->query($sql) === TRUE) {
echo " New record created successfully";
}
else{
echo " Error: " . $sql . "<br>" . $conn->error;
}
}
else
{ echo "1";
$sql="UPDATE delay SET ".$team."=".$delay." WHERE sno=".$roundno;
if ($conn->query($sql) === TRUE) {
echo " UPDATED";
}
else{
echo " Error: " . $sql . "<br>" . $conn->error;
}
}
}
$conn->close();
?>