Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [{
- "0": "1",
- "id": "1",
- "1": "Hakob",
- "name": "Hakob",
- "2": "abc@email.com",
- "email": "abc@email.com"
- }, {
- "0": "2",
- "id": "2",
- "1": "Arsen",
- "name": "Arsen",
- "2": "zxc@email.com",
- "email": "zxc@email.com"
- }]
- $sql = "SELECT * FROM contacts";
- $result = mysqli_query($connect, $sql);
- $response = array();
- while($row = mysqli_fetch_array($result)){
- $response[]=$row;
- }
- print json_encode($response);
- // Close connection
- mysqli_close($connect);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement