-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete-order.php
45 lines (39 loc) · 1.13 KB
/
delete-order.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
<?
/*****************************************************
Developer: macdonaldgeek
Email: [email protected]
Phone: +255-657-567401/+254-717-667201/+44-744-0579061
Twitter: @macdonaldgeek
COPYRIGHT ©2014 RESTAURANT SCRIPT. ALL RIGHTS RESERVED
******************************************************/
?>
<?php
//checking connection and connecting to a database
require_once('connection/config.php');
//Connect to mysql server
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
die("Unable to select database");
}
// check if the 'id' variable is set in URL
if (isset($_GET['id']))
{
// get id value
$id = $_GET['id'];
// delete the entry
$result = mysql_query("DELETE FROM orders_details WHERE order_id='$id'")
or die("The order does not exist ... \n");
// redirect back to the member index
header("Location: member-index.php");
}
else
// if id isn't set, redirect back to member index
{
header("Location: member-index.php");
}
?>