Inserting records into remote mySQL

Brad

Active Member
Licensed User
Longtime User
Ok, I'm a :sign0104: at PHP and HTML.. I'm attempting to insert records into a mySQL table. I'm passing the values inserted into the url to a PHP script which does the actual inserting. It works when I use a browser but not from my device. Nothing happens. No results from either the ResponseSuccess or ResponseError subs.. Here's a code example. From my research it appears that I use the get method. Is that correct or should I be using post?
B4X:
' http_req is dim as HttpClient in global

dim sURL as String
Dim request As HttpRequest
        ProgressDialogShow("Please wait...Updating")
   sURL = "http://www.mydomain.com/test.php?name=Bob&age=25"
   request.InitializeGet(sURL)
   request.Timeout=30000
        If Http_req.Execute(request, 1) = False Then Return

Been fighting this for hours and from past experience I'm missing something very basic. :BangHead:
 
Last edited:

Brad

Active Member
Licensed User
Longtime User
Nothing is returning which is strange. I'll take a look at HttpUtils..Just thought with just a simple process I shouldn't need HttpUtils.
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Do you have access to the webserver?

Can you look through the server logs to see if your app requests appear and see the exact request being sent from your B4A app to the server?

Martin.
 
Upvote 0

Brad

Active Member
Licensed User
Longtime User
Thanks warwound..that idea let me to the solution. The log showed nothing from my mobile.. The problem was, drum roll please, I had forgotten to initialize the HttpClient..usually this throws an error but apparently not this. So now I'll go :BangHead::BangHead:
 
Upvote 0
Top