forked from SeeTurtle-team/WebServerPrograming_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendBroad.php
More file actions
51 lines (32 loc) · 1.37 KB
/
endBroad.php
File metadata and controls
51 lines (32 loc) · 1.37 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
<?php
session_start();
$userId = $_SESSION['userId'];
$id = $_GET['userId'];
//채팅지우기
$con = mysqli_connect("database-1.c9g35ixldt8h.ap-northeast-2.rds.amazonaws.com", "admin", "00000000", "project");
$sql = "delete from tableforchat where seq=$seq";
mysqli_query($con, $sql);
//추천수 합치기
$seq = $_GET['seq'];
$con = mysqli_connect("database-1.c9g35ixldt8h.ap-northeast-2.rds.amazonaws.com", "admin", "00000000", "project");
$sql = "select * from broadCast where seq= $seq";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result);
$recommend = $row['recommend'];
$sql1 = "select * from member where UserId= '$id'";
$result1 = mysqli_query($con, $sql1);
$row = mysqli_fetch_array($result1);
$memberRecommend = $row['recommend'];
$memberRecommend = $memberRecommend + $recommend;
$sql1 = "update member set recommend = $memberRecommend where UserId= '$id'";
mysqli_query($con, $sql1);
//방송 데이터 삭제
$con = mysqli_connect("database-1.c9g35ixldt8h.ap-northeast-2.rds.amazonaws.com", "admin", "00000000", "project");
$sql = "delete from broadCast where seq = $seq";
$result = mysqli_query($con, $sql);
echo "
<script>
location.href = 'index.php';
</script>
";
?>