Created
June 5, 2018 10:46
-
-
Save hoxsec/fdb739c7b6a9707a32971928a6f9e909 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 | |
require_once 'DB_FILE_HERE'; | |
// SQL statement | |
$sql = mysqli_query($conn, "QUERY_HERE"); | |
// Define array for row | |
$rows = array(); | |
// Set each row into array. | |
while ($row = $sql->fetch_assoc()) { | |
$rows[] = $row; | |
} | |
// Echo JSON array | |
print json_encode($rows); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment