-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcust-del.php
44 lines (36 loc) · 981 Bytes
/
cust-del.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
<?php
/*
DELETE.PHP
Deletes a specific entry from the 'players' table
*/
// header
include('header.php');
// connect to the database
include('linkupdb.php');
// check if the 'id' variable is set in URL, and check that it is valid
if (isset($_GET['customerNumber']) && is_numeric($_GET['customerNumber']) && $_GET['customerNumber'] > 0)
{
// get id value
$customerNumber = $_GET['customerNumber'];
// delete the entry
$result = mysql_query("DELETE FROM customers WHERE customerNumber='$customerNumber'")
or die(mysql_error());
?>
<div class="jumbotron">
<h1>Deleted!</h1>
<p> <?php echo '<div class="alert alert-danger">Delete customer within the database </div>';?> </p>
</div>
<?php
}
else
{
?>
<div class="jumbotron">
<h1>No Information!</h1>
<p> <?php echo '<div class="alert alert-danger">Unable to find customer within the database </div>';?> </p>
</div>
<?php
}
// footer
include('footer.php');
?>