Last active
March 27, 2017 17:05
-
-
Save itswadesh/65ca5b290e842c6320fa426ad3af63db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include('../includes/config.php'); | |
$query="select distinct c.customerName, c.addressLine1, c.city, c.state, c.postalCode, c.country, c.creditLimit from customers c order by c.customerNumber"; | |
$result = $mysqli->query($query) or die($mysqli->error.__LINE__); | |
$arr = array(); | |
if($result->num_rows > 0) { | |
while($row = $result->fetch_assoc()) { | |
$arr[] = $row; | |
} | |
} | |
# JSON-encode the response | |
$json_response = json_encode($arr); | |
// # Return the response | |
echo $json_response; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment