 <?php

include '../../conn.php';

$userid=$_GET['userid'];


$resultdata =$con->query("select * from `transaction` where paitentId='$userid' order by id desc");
$transaction=array();
while($row = mysqli_fetch_array($resultdata)){


array_push($transaction,
      array(
            'id'=>$row['id'],
            'remark'=>$row['remark'],
            'lastamount'=>$row['lastAmount'],
            'createTime'=>$row['createTime'],
            
          	));
    }

 echo json_encode(array("result"=>$transaction));
?>