This code is able to retrieve records from the server
GetTransactions is unable to work. it returns [] when i checked the log. Am i doing anything wrong in this "GetTransactions"
B4X:
$q = mysqli_query($con,"SELECT * FROM DepositTransactions");
$rows = array();
while($r = mysqli_fetch_assoc($q))
{
$rows[] = $r;
}
echo json_encode($rows);
mysqli_close($con);
GetTransactions is unable to work. it returns [] when i checked the log. Am i doing anything wrong in this "GetTransactions"
B4X:
Dim DownloanTransactions As HttpJob
DownloanTransactions.Initialize("DownT", Me)
DownloanTransactions.Download2(Server, Array As String ("action", "GetTransactions","memberID",MemberID,"lasttrans",LastTransID))
B4X:
$action = $_GET["action"];
switch ($action)
{
case "CountPersons":
$q = mysqli_query($con,"SELECT * FROM DepositTransactions WHERE MemberID=40001762");
$count = mysqli_num_rows($q);
print json_encode($count);
mysqli_close($con);
break;
Case "GetTransactions":
$memberid = $_GET["memberid"];
$lasttrans = $_GET["lasttrans"];
$q = mysqli_query($con,"SELECT * FROM DepositTransactions WHERE MemberID=$memberid AND TranNo>$lasttrans");
$rows = array();
while($r = mysqli_fetch_assoc($q))
{
$rows[] = $r;
}
print json_encode($rows);
mysqli_close($con);
break;
Last edited: