-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget.php
30 lines (23 loc) · 932 Bytes
/
get.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
<?php
header("Content-Type:application/json");
include('connection.php');
if (isset($_GET['customer_id']) && $_GET['customer_id']!="") {
$customer_id = $_GET['customer_id'];
$query = "SELECT * FROM `customers` WHERE customer_id=$customer_id";
$result = mysqli_query($con,$query);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
$customerData['customer_id'] = $row['customer_id'];
$customerData['customer_name'] = $row['customer_name'];
$customerData['customer_email'] = $row['customer_email'];
$customerData['customer_contact'] = $row['customer_contact'];
$customerData['customer_address'] = $row['customer_address'];
$customerData['country'] = $row['country'];
$response["status"] = "true";
$response["message"] = "Customer Details";
$response["customers"] = $customerData;
} else {
$response["status"] = "false";
$response["message"] = "No customer(s) found!";
}
echo json_encode($response); exit;
?>