Android Question Rewrite code in PHP

ProjectGroup19

Active Member
Licensed User
Please, how do i rewrite the below code To PHP

B4X:
Dim Data As List
    Data.Initialize
    Dim rs As ResultSet = Connection.DB.ExecQuery("SELECT USERNAME, FULLNAME, CONTACT, EMAIL, USERTYPE, JDATE, APPROVE FROM ACCOUNT")
    Do While rs.NextRow
        Dim row(8) As Object
        row(0) = ""
        row(1) = rs.GetString("USERNAME")
        row(2) = rs.GetString("FULLNAME")
        row(3) = rs.GetString("CONTACT")
        row(4) = rs.GetString("EMAIL")
        row(5) = rs.GetString("USERTYPE")
        row(6) = rs.GetString("JDATE")
        row(7) = rs.GetString("APPROVE")
        Data.Add(row)
        
    Loop
    rs.Close
    
    B4XTable1.SetData(Data)
 

drgottjr

Expert
Licensed User
Longtime User
i find the question strange. do you mean you want to upload the data to a server running a php script? (and what might that script do?) or do you simply want to translate your b4a to php? (in which case, where are you going to run it, since android, b4x and b4xtable have nothing to do with php?) what's going on?
 
Upvote 0

ProjectGroup19

Active Member
Licensed User
i find the question strange. do you mean you want to upload the data to a server running a php script? (and what might that script do?) or do you simply want to translate your b4a to php? (in which case, where are you going to run it, since android, b4x and b4xtable have nothing to do with php?) what's going on?

The script should retrieve data from a MySql database and then i pass it to b4xtable.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
so, there is a server somewhere with a MySql database? and you want to have it run a select which you will then download and display in a table? if yes, are you running that server and/or are you authorized to run a php script on that server and/or are you authorized to make requests to the administrator resulting in a custom script for your use? if no, you can't do what you're asking. if yes, the syntax for making a MySql select and stepping through the results will look very familiar to you when you see it. but unless you're administering the server, it's going to be tough to get anything going. plus there's no sense getting into php if you're not allowed to run it on the server.

that said, technically, if there is an online form that users can populate to make the server spill its guts, then you could leverage that form to make an httputils request directly to the server as if you were the online form. do you understand? you mimic the form, if such a form exists. it's done all the time and simply replaces the form with a direct request. perfectly legal.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top