-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdelete_user.php
40 lines (35 loc) · 1.36 KB
/
delete_user.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
<?php include('header.inc.php'); ?>
<?php
$matric = $_GET['user'];
// Cart .....
$query44 = "SELECT * FROM cart WHERE matric = '$matric'";
$result44 = mysql_query($query44)
or die ("Couldn't execute query44.");
while ($row44 = mysql_fetch_array($result44,MYSQL_ASSOC))
{
$query3 ="DELETE FROM cart WHERE matric = '$matric'";
$result3 = mysql_query($query3) or die('could not execute query3');
}
// Wallet .....
$query44 = "SELECT * FROM wallet WHERE matric = '$matric'";
$result44 = mysql_query($query44)
or die ("Couldn't execute query44.");
while ($row44 = mysql_fetch_array($result44,MYSQL_ASSOC))
{
$query3 ="DELETE FROM wallet WHERE matric = '$matric'";
$result3 = mysql_query($query3) or die('could not execute query3');
}
// Meals Bought .....
$query44 = "SELECT * FROM meals_bought WHERE matric = '$matric'";
$result44 = mysql_query($query44)
or die ("Couldn't execute query44.");
while ($row44 = mysql_fetch_array($result44,MYSQL_ASSOC))
{
$query3 ="DELETE FROM meals_bought WHERE matric = '$matric'";
$result3 = mysql_query($query3) or die('could not execute query3');
}
// Main User Account ....
$query3 ="DELETE FROM user WHERE matric = '$matric'";
$result3 = mysql_query($query3) or die('could not execute query3');
echo("<script>location.href = 'users.php';</script>");
?>