I am fetching information from my database as JSON array.The problem is i am unable to use this data to compare using if else or assign to a PHP variable.
query:
$query="select * from dmo";
$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
$json_response = json_encode($arr);
// # Return the response
echo $json_response;
Data:
<tr ng-repeat="data in filtered = (list | filter:search | orderBy : predicate :reverse) | startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit">
<td>{{data.tran_id}}</td>
<td>{{data.tran_type}}</td>
<td>{{data.sender}}</td>
<td>{{data.amount}}</td>
<td>{{data.fee}}</td>
<td>{{data.date}}</td>
<td>
<?php $s="{{data.status}}"; if ($s == "0")
echo"Pending";
else if ($s == "1") echo"Completed";
?>
</td>
</tr>