Android Question mysql integration

karld

Active Member
Licensed User
Longtime User
I have been playing with the tutorial at
https://www.b4x.com/android/forum/threads/connect-android-to-mysql-database-tutorial.8339/

I want to just send a number over to a php script. The script will use that number to determine which pre-defined query to run.

I want to avoid sending a full query string over.

How in bloody, blue, blazes does one do this?

I can't seem to figure out how to just send a POST to the php page with only the parameter I want.
 

ronell

Well-Known Member
Licensed User
Longtime User
you can use httputils

B4X:
Dim job1 As HttpJob
    job1.Initialize("job1", Me) 
    job1.Download2(url, _
    Array As String("id",txtid))
 
Upvote 0

karld

Active Member
Licensed User
Longtime User
you can use httputils

Ronell,

Thanks...
I actually figured it out about 20 minutes ago!
I was able to finally get Erel's sample code working.
The biggest change was that I am only passing a number code... That is looked up by the php script and then runs the matching
SQL statement. That should take care of SQL injection issues.

Shoots back a json.

I am going to tuck your code away in case I need it for any other projects..
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…