Guest User

Untitled

a guest
Aug 8th, 2017
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. [{
  2. "0": "1",
  3. "id": "1",
  4. "1": "Hakob",
  5. "name": "Hakob",
  6. "email": "[email protected]"
  7. }, {
  8. "0": "2",
  9. "id": "2",
  10. "1": "Arsen",
  11. "name": "Arsen",
  12. "email": "[email protected]"
  13. }]
  14.  
  15. $sql = "SELECT * FROM contacts";
  16. $result = mysqli_query($connect, $sql);
  17. $response = array();
  18. while($row = mysqli_fetch_array($result)){
  19. $response[]=$row;
  20. }
  21.  
  22. print json_encode($response);
  23.  
  24. // Close connection
  25. mysqli_close($connect);
Advertisement
Add Comment
Please, Sign In to add comment