-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetstatcut.php
105 lines (73 loc) · 2.51 KB
/
setstatcut.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
// session_start();
// $servername = "localhost";
// $username = "root";
// $password = "";
// $dbname="ludo";
include("config.php");
$cut= $_POST['cut'];
$cutby= $_POST['cutby'];
// $fel= $_POST['fel'];
// $setdun= $_POST['set'];
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed:". $conn->connect_error);
}
$sql1 = "SELECT * FROM stat WHERE id=1";
$result = $conn->query($sql1);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
// if($id==1){
// $temp="r".$dun;
$temp1=$cut[0]."cutb".$cutby[0];
$temp=$cutby[0]."cut".$cut[0];
$temp2=$row[$temp]+1;
$temp3=$row[$temp1]+1;
$sql = "UPDATE stat SET $temp=$temp2 ";
$result1 = $conn->query($sql);
$sql2 = "UPDATE stat SET $temp1=$temp3 ";
$result2 = $conn->query($sql2);
}
}
// }
// else if($id==2){
// $temp="g".$dun;
// // $sql = "UPDATE stat SET $temp=$id ";
// $temp1=$row[$temp];
// $sql = "UPDATE stat SET $temp=$temp1+1 ";
// $result = $conn->query($sql);
// }
// else if($id==3){
// $temp="b".$dun;
// // $sql = "UPDATE stat SET $temp=$id ";
// $temp1=$row[$temp];
// $sql = "UPDATE stat SET $temp=$temp1+1 ";
// $result = $conn->query($sql);
// }
// else if($id==4){
// $temp="y".$dun;
// // $sql = "UPDATE stat SET $temp=$id ";
// $temp1=$row[$temp];
// $sql = "UPDATE stat SET $temp=$temp1+1 ";
// $result = $conn->query($sql);
// }
// if($id==1){
// $temp="r".$dun;
// $sql = "UPDATE stat SET $temp= ";
// }
// else if($id==2){
// $temp="g".$dun;
// $sql = "UPDATE stat SET $temp=$id ";
// }
// else if($id==3){
// $temp="b".$dun;
// $sql = "UPDATE stat SET $temp=$id ";
// }
// else if($id==4){
// $temp="y".$dun;
// $sql = "UPDATE stat SET $temp=$id ";
// }
$conn->close();
echo $temp1;
?>