-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdel_fav.php
More file actions
28 lines (19 loc) · 804 Bytes
/
del_fav.php
File metadata and controls
28 lines (19 loc) · 804 Bytes
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
<?php
session_start();
$db = new mysqli('127.0.0.1', 'root', '', 'player_stats');
$q = "DELETE FROM users_igrac WHERE ID=" . $_SESSION['id'] . " AND reg_br_igr='" . $_GET['id'] . "'";
$db->query($q);
$q = "SELECT ime, prezime FROM igrac WHERE reg_br_igr='" . $_GET['id'] . "'";
$res = $db->query($q);
$name;
$last;
$showDate = date("Y-m-d h:i:s");
while( $r = $res->fetch_assoc() ) {
$name = $r['ime'];
$last = $r['prezime'];
}
$not = $showDate . "<br>You are no longer following player " . $name . " " . $last;
$q = "INSERT INTO users_notifications (ID, reg_br_igr, notification, seen, was_fav, recieved) VALUES (" . $_SESSION['id'] . ", '" . $_GET['id'] . "', '" . $not . "', 1, 1, '" . $showDate . "')";
$db->query($q);
header('Location: player.php?id=' . $_GET['id']);
?>