-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathEdit-Comment-Event.php
More file actions
46 lines (26 loc) · 862 Bytes
/
Copy pathEdit-Comment-Event.php
File metadata and controls
46 lines (26 loc) · 862 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
session_start();
include('config.php');
if (isset($_POST['edit-comment'])) {
$post_id = $_POST['post_id'];
$comment_id = $_POST['comment_id'];
$comment = $_POST['comment'];
Update_Comment($post_id, $comment, $comment_id);
} else {
}
function Update_Comment($post_id, $post_comment, $comment_id)
{
include 'config.php';
$SQL = "UPDATE comments_events SET COMMENT = '$post_comment' WHERE COMMENT_ID = $comment_id;";
echo $SQL;
$stmt = $conn->prepare($SQL);
if ($stmt->execute()) {
$send = "Single-Event.php?post_id=$post_id&success_message=Current Opinion Updated Successfully";
header("location: $send");
exit;
} else {
$send = "Single-Event.php?post_id=$post_id&error_message=Problem With Update Opinion";
header("location: $send");
exit;
}
}