-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
52 lines (26 loc) · 987 Bytes
/
delete.php
File metadata and controls
52 lines (26 loc) · 987 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
52
<?php
session_start();
$servername="localhost";
$username="root";
$password = "";
$database="bank";
$con= mysqli_connect($servername, $username, $password, $database);
if(!$con){
die("connection to this databse failed due to". mysqli_connect_error());
}
// echo "connection successful";
$anum=$_POST['account_number']??null;
// if(!$id){
// header('Location:customer.php');
// exit;
// }
$sql = "DELETE FROM `detail` WHERE `detail`.`account_number` = '$anum'";
$result= mysqli_query($con,$sql);
if($result){
$_SESSION['status']="<div class='alert alert-warning alert-dismissible fade show' role='alert'>
<strong>Account has been deleted sucessfully.</strong>
<button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button>
</div>";
header("Location:customer.php");
}
?>