-
Notifications
You must be signed in to change notification settings - Fork 1
/
delete.php
36 lines (29 loc) · 862 Bytes
/
delete.php
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
<?php
session_start();
// Using database connection file here
$db = mysqli_connect("localhost","root","","vaccineregistration");
if(!$db)
{
die("Connection failed: " . mysqli_connect_error());
}
$id = $_GET['id']; // get id through query string
$name = $_GET['account_name'];
$m_n = $_GET['name'];
$sql = "DELETE FROM members where id='$id'";
$del = mysqli_query($db, $sql); // delete query
// $name = $_SESSION['username'];
// $m_n = $_SESSION['name'];
$sql1 = "DELETE FROM bookedSlots where account_name='$name' AND name='$m_n' ";
echo $sql1;
$del1 = mysqli_query($db, $sql1); // delete query
if($del)
{
mysqli_close($db); // Close connection
header("location:members.php"); // redirects to all records page
exit;
}
else
{
echo "Error deleting record"; // display error message if not delete
}
?>