-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetlist_read_syd_1.php
40 lines (34 loc) · 1.2 KB
/
getlist_read_syd_1.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
header("Content-Type:application/json");
include('connection_read_syd_1.php');
$page_size = 10;
if (isset($_GET['page_size']) && $_GET['page_size']!="" && is_numeric($_GET['page_size']))
{
$page_size = $_GET['page_size'];
}
try
{
$query = "SELECT * FROM `customers` Order by `customer_id` Desc Limit 0 , $page_size ";
$result = mysqli_query($con_read_syd_1,$query);
$rownumber=0;
while($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'];
$customerList[$rownumber]=$customerData;
$rownumber++;
}
$response["status"] = "true";
$response["message"] = "Customers List";
$response["customers"] = $customerList;
} catch(Exception $ex) {
$response["status"] = "false";
$response["message"] = $ex->getMessage();
} finally {
echo json_encode($response); exit;
}
?>