Last active
March 27, 2017 17:22
-
-
Save itswadesh/06bf89bc09c3e9ced3a928c27d9ffc60 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
<?php | |
require_once '../includes/db.php'; // The mysql database connection script | |
$status = '%'; | |
if(isset($_GET['status'])){ | |
$status = $_GET['status']; | |
} | |
$query="select ID, TASK, STATUS from tasks where status like '$status' order by status,id desc"; | |
$result = $mysqli->query($query) or die($mysqli->error.__LINE__); | |
$arr = array(); | |
if($result->num_rows > 0) { | |
while($row = $result->fetch_assoc()) { | |
$arr[] = $row; | |
} | |
} | |
# JSON-encode the response | |
echo $json_response = json_encode($arr); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment