Android Question B4A Mysql question

apty

Active Member
Licensed User
Longtime User
I am connecting to an online mysql db using B4A job. My table has questions and i would like to move from one question to the next using previous/next buttons.

What i have done so far is to add the id of the questions to a list. I then use an index and set it to
Code: Copy
    CurrentIndex = questionslist.Size
my questionslist.size returns the correct number of questions from the table

How can i use it to get the exact question and post it on current page, then when i click next, it moves to the next question?
 
i am connecting as below:
Code: Copy
Sub selectquestions
 
    ExecuteSelectQuery("select question,id from questions",Q_SELECT)
  

End Sub
Sub ExecuteSelectQuery(Query As String, JobName As String)
    Dim job2 As HttpJob
  
    job2.Initialize("job2", Me)
  
    job2.PostString(url, Query)
  
End Sub

I then use the below code in JobDone

Code: Copy
questionslist.Add(m.Get("id"))

The questionslist contains ids of the questions.
 
Upvote 0
Thanks. The problem i am having is how to move to next and previous pages showing next and previous questions. For example if my list has the following
Code: Copy
[{"question":"test question"},{"question":"test question2"},{"question":"test question3"}]
and i have a layout with a label and two buttons (previous and next buttons). How can i show the question on the label and move to next question on clicking next button?
 
Upvote 0
Back
Top