Android Tutorial Connect Android to MySQL Database Tutorial

Discussion in 'Tutorials & Examples' started by Erel, Mar 21, 2011.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this in B4i forum.
     
  2. Paul Edwards

    Paul Edwards Member Licensed User

    Hi Erel,

    How to modify the code in the tutorial to send an update to the database?

    Paul
     
  3. DonManfred

    DonManfred Expert Licensed User

    1. this is a comunity forum. Don´t limit your question to a single member.
    2. Always create a new thread in the questions forum for any question you have.
     
  4. Walter Scafati

    Walter Scafati Member Licensed User

    Hi, I have a question about the connection to remote DB mySQL: I realized a App able to read and write a table on remote mySQL DB located on my server.
    In the table there is also a BLOB field for the image. I can send the Data fields completed of blob field to DB on the server converting the field to string data

    Buffer2 = cursoreTmp.GetBlob("image")
    If Buffer2 <> Null Then encoded = su.EncodeBase64(Buffer2) 'data is a bytes array
    ExecuteRemoteQuery2(ADati, encoded)


    Sub ExecuteRemoteQuery2(par() As String, Buffer2 As String)
    Dim job As HttpJob
    Dim myInd As Int

    job.Initialize("q000", Me)
    job.PostString("http://" & ip & "/" & page & ".php?par1=" & par(1) & "&par2=4&par3=" & par(2) & "&par4=" & par(2).length, Buffer2)
    End Sub


    The problem is when I try to request the data from the server, only when the BLOB field in not empty.

    In the JobDone sub I have the error in the follow instruction (parser.NextArray)

    Dim MYDATA As List
    MYDATA = parser.NextArray 'returns a list with maps


    I think I'm not correct conversion of the BLOB field in the string in the php files on the server.

    What do you think? Where can be the problem?

    Thanks.
     
  5. DonManfred

    DonManfred Expert Licensed User

    You should always start a new thread for your questions.
     
  6. Walter Scafati

    Walter Scafati Member Licensed User

    Why? Is the question not pertinent with main title of this post?
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    This is the forum policy. Each questions should be posted in a new thread. You should also use code tags.
     
  8. Walter Scafati

    Walter Scafati Member Licensed User

    Ah OK! sorry!
    I will create a new thread.
     
    Erel likes this.
  9. RichB

    RichB New Member Licensed User

    Hi, my sql queries and php work fine over the local network and if I specify the actual IP address of the server. But they won't work when I use a http://www.mysite.com address?

    Any ideas why? I see in the example it works fine using "https://www.b4x.com/android/countries.php" so why does mine only work when I use http://82.x.x.x.x/myphpfile.php.

    Thanks in advance for any help.

    EDIT: A little more info, it doesn't give me an error. It is just that the response from the server appears to be in HTML
     
  10. DonManfred

    DonManfred Expert Licensed User

    does the php output html-code?

    Best is to start a NEW thread in the questionsforum and upload a sample project which shoes the issue.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice