-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinsert_pagination.php
More file actions
56 lines (53 loc) · 2.22 KB
/
insert_pagination.php
File metadata and controls
56 lines (53 loc) · 2.22 KB
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
<?php
$conn = new mysqli('127.0.0.1', 'root','','player_stats');
if ($conn->connect_error) {
die("Uspostavljanje konekcije nije uspjelo: ". $conn->connect_error);
}
if (isset($_POST["optradio"])){
$query = "UPDATE service_table SET val = ? WHERE idService = 1";
$sql_query = $conn->prepare($query);
$sql_query->bind_param("i", $_POST["optradio"]);
$sql_query->execute();
}
if (isset($_POST["name"])) {
$retval = $_POST["name"];
$txt = $_POST["text"];
//echo $txt;
//echo $retval;
switch($retval) {
case 3:
if($txt == '') {
$query = "UPDATE service_table SET val = 0 WHERE idService = 3";
} else {
$querytxt = "UPDATE service_table SET txt = '$txt' WHERE idService = 3";
$sql_query_txt = $conn->prepare($querytxt);
$sql_query_txt->execute();
$query = "UPDATE service_table SET val = 1 WHERE idService = 3";
}
break;
case 4:
if($txt == '' || $txt == 'null') {
$query = "UPDATE service_table SET val = 0 WHERE idService = 4";
} else {
$querytxt = "UPDATE service_table SET txt = '$txt' WHERE idService = 4";
$sql_query_txt = $conn->prepare($querytxt);
$sql_query_txt->execute();
$query = "UPDATE service_table SET val = 1 WHERE idService = 4";
}
break;
case 5:
if($txt == 'null' || $txt == '') {
$query = "UPDATE service_table SET val = 0 WHERE idService = 5";
} else {
$querytxt = "UPDATE service_table SET txt = '$txt' WHERE idService = 5";
$sql_query_txt = $conn->prepare($querytxt);
$sql_query_txt->execute();
$query = "UPDATE service_table SET val = 1 WHERE idService = 5";
}
break;
}
$sql_query = $conn->prepare($query);
//$sql_query->bind_param('i', $_POST["name"]);
$sql_query->execute();
}
?>