Private Sub Button1_Click
'Here, Error message : "champs1 does'nt exist"
ExecuteRemoteQuery("INSERT INTO Mytable (col1, col2, col3) VALUES (champs1, champs2, champs3)",ENVOI)
'Here, it runs but it writes Champs1, champs2, et champs3 and not the content of the variables
ExecuteRemoteQuery("INSERT INTO Mytable (column1, column2, column3) VALUES ('champs1', 'champs2', 'champs3')",ENVOI)
End Sub
Sub ExecuteRemoteQuery(Query As String, JobName As String)
Dim job As HttpJob
job.Initialize(JobName, Me)
job.PostString("https://mysite.fr/applis/myappli.php", Query)
End Sub
Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
Dim res As String
res = Job.GetString
Log("Response from server: " & res)
Dim parser As JSONParser
parser.Initialize(res)
Select Job.JobName
Case CHERCHE_NOMS
Dim NOMS As List
MAILS = parser.NextArray 'returns a list with maps
For i = 0 To NOMS.Size - 1
Dim m As Map
m = NOMS.Get(i)
' etc..........
Next
Case ENVOI
Dim champs1, champs2, champs3 as string
champs1 = "Hello"
champs2 = "The"
champs3 = "World"
End Select
Else
Log(Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub