Last active
November 24, 2016 06:33
-
-
Save geoluther/f2e2538c1379055a18df663e87fa9d0e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| $json = array(); | |
| $result = mysqli_query ($connection, $query); | |
| while($row = mysqli_fetch_array ($result)) | |
| { | |
| $data = array( | |
| 'field1' => $row['field1'], | |
| 'field2' => $row['field2'] | |
| ); | |
| array_push($json, $data); | |
| } | |
| $jsonstring = json_encode($json); | |
| echo $jsonstring; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment