Android Question save list data

RUNO

Active Member
Licensed User
Longtime User
Hello all
I want save list data for user with one request .
I tried to search in forum about any post for saving a list data in a remote database , but I didn't found.

can anyone help me ?
I used this code but I think not practical
B4X:
For i=0 To list2.Size-1
        Dim a As MyData
        a=list2.Get(i)
        Dim job As HttpJob
        job.Initialize("",Me)
        job.Download2(URL& "save_data.php", _
                       Array As String("UserID",user_no,"desc",a.desc,"price",a.price, _
                        "kind",a.k,"date_b", _
                        a.date,"status",status))
        Wait For (job) JobDone(job As HttpJob)
        If job.Success Then
        log("==")
            end if
        job.Release
    Next
 
Last edited:

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
The simplest solution is to update save_data.php to accept an array of arrays then you can pass in list2 directly.

edit:
Also, if you are saving data, you should really be using post (e.g. PostString) rather than download which is GET
 
Upvote 0
Top