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;
$q = mysqli_query($con,"SELECT * FROM DepositTransactions WHERE MemberID='$memberid' AND TranNo>'$lasttrans'");
Display $q to see if sql is well formed!
ECHO $q
$q = mysqli_query($con,"SELECT * FROM DepositTransactions WHERE MemberID='$memberid' AND TranNo>'$lasttrans'");
Display $q to see if sql is well formed!
ECHO $q
Thanks @tigrot. This is the error am getting from the error log
<b>Parse error</b>: syntax error, unexpected '$rows' (T_VARIABLE), expecting ',' or ';' in <b>/home/sikasoft/public_html/app/newCon.php</b> on line <b>39</b><br />
I have modified the code and am now getting this "Response from server: []"
Not getting the actual data. is there anything wrong with my code?
B4X:
Dim DownloanTransactions As HttpJob
DownloanTransactions.Initialize("DownT", Me)
DownloanTransactions.Download2(Server, Array As String ("action", "GetTransactions","memberID",MemberID,"lasttrans",LastTransID))