Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2. include('../includes/config.php');
  3.  
  4. $query="select distinct c.customerName, c.addressLine1, c.city, c.state, c.postalCode, c.country, c.creditLimit from customers c order by c.customerNumber";
  5. $result = $mysqli->query($query) or die($mysqli->error.__LINE__);
  6.  
  7. $arr = array();
  8. if($result->num_rows > 0) {
  9. while($row = $result->fetch_assoc()) {
  10. $arr[] = $row;
  11. }
  12. }
  13. # JSON-encode the response
  14. $json_response = json_encode($arr);
  15.  
  16. // # Return the response
  17. echo $json_response;
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement