-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremove.php
47 lines (39 loc) · 1.48 KB
/
remove.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
37
38
39
40
41
42
43
44
45
46
47
<?php
session_start();
$dbservername = 'localhost';//or localhost
$dbname = 'project'; // your db_name
$dbusername = 'root'; // root by default for localhost
$dbpassword = ''; // by defualt empty for localhost
//delete details
$patid=$_POST["patientlist"];
$docpas=$_POST["docpwd"];
if($docpas==$_COOKIE["password"])
{
$sql="delete from users where username='$patid'";
$sql1="delete from readings where patientname='$patid'";
//Delete from user table
$conn = new mysqli($dbservername, $dbusername, $dbpassword, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if ($conn->query($sql) === TRUE)
{
if ($conn->query($sql1) === TRUE)
{
$_SESSION["Del"]="s";
header("location:doctor.php");
}
else
{
$_SESSION["Del"]="f";
header("location:doctor.php");
}
}
else
{
$_SESSION["Del"]="f";
header("location:doctor.php");
}
$conn->close();
}
?>