Last active
March 9, 2018 09:03
-
-
Save arif98741/b38323d9651fe6b1c50b0e143320a0a2 to your computer and use it in GitHub Desktop.
JSON Data Retrive
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
<?php | |
$con = new mysqli("localhost","root","","database"); | |
$result = array(); | |
if($con) | |
{ | |
$stmt = $con->query("select * from android_data"); | |
//$stmt = $con->query("select * from tbl_invoice_products"); | |
if($stmt) | |
{ | |
while($row = $stmt->fetch_assoc()) | |
{ | |
$result[] = $row; | |
} | |
echo json_encode($result); | |
} | |
}else{ | |
$result['error'] = "Connection Failed"; | |
echo json_encode($result); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment