-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
30 lines (23 loc) · 821 Bytes
/
delete.php
File metadata and controls
30 lines (23 loc) · 821 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
<?php
session_start();
header("Content-Type:text/html;charset=utf-8");
$host = '127.0.0.1';
$user = 'root';
$pw = 'chanki';
$dbName = 'healthcare';
$port = 3306;
$mysqli = new mysqli($host, $user, $pw, $dbName,$port);
if($mysqli === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
$name= $_SESSION['login_session']['memberId'];
$sql[0] = "DELETE FROM userinfo WHERE memberId like '{$name}'";
$sql[1] = "DELETE FROM healthinfo WHERE memberId like '{$name}'";
$sql[2] = "DELETE FROM shorttable WHERE memberId like '{$name}'";
$sql[3] = "DELETE FROM weight WHERE memberId like '{$name}'";
$sql[4] = "DELETE FROM sikdan WHERE memberId like '{$name}'";
for($i=0 ; $i<5; $i++){
$mysqli->query($sql[$i]);
}
echo("<script>location.replace('./logout.php');</script>");
?>