-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeletEvent.php
More file actions
51 lines (31 loc) · 968 Bytes
/
Copy pathdeletEvent.php
File metadata and controls
51 lines (31 loc) · 968 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
46
47
48
49
50
51
<?php
include_once"cbumobileConnection.php";
$eventId=$_GET['newsId'];
$eventid=filter_var($eventId,FILTER_SANITIZE_NUMBER_INT);
$stm= mysqli_prepare($connection,"DELETE FROM events WHERE EventId=?");
if(isset($stm)){
mysqli_stmt_bind_param($stm,"d",$eventid);
mysqli_stmt_execute($stm);
if(mysqli_affected_rows($connection) > 0){
mysqli_stmt_close($stm);
$status="Success";
$message="Selected news has been deleted";
sendinformation($status,$message);
}else{
$status="Fail";
$message="No news is deleted";
sendinformation($status,$message);
}
}else{
mysqli_stmt_close($stm);
$status="Fail";
$message="Problem with preparing a statement.";
sendinformation($status,$message);
}
function sendinformation($status, $message){
$fail['Status']=$status;
$fail['Message']=$message;
$failure[]=$fail;
print(json_encode($failure));
}
?>