B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim MYSQIP = "xxx.xxx.xxx.xx" As String
Dim MYSQPORT = "xxxx" As String
Dim MYSQUSER = "mocpayne" As String
Dim MYSQPASS = "xxxxx" As String
Dim MYDB = "mocpayne_sample" As String
Dim connection As MariaDBConnector
Dim cursor1 As Cursor
End Sub
Sub Globals
Private Button1 As Button
Private EditText1 As EditText
Private EditText2 As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
connection.Initialize(MYSQIP,MYSQPORT,MYSQPASS,MYSQUSER,MYDB)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
If EditText1.text = "" And EditText2.Text = "" Then
Msgbox("fill up the fields","error")
Else
cursor1 = connection.ExecQuery("query","SELECT * FROM Accounts where user_name='" & EditText1.Text & "' and user_password='" & EditText2.Text & "'")
If cursor1.RowCount<>0 Then
Msgbox("login successful","")
End If
End If
End Sub
i have this error: Cannot assign void value.
i want to connect my app to mySQL database by entering user and pass in the 2 textboxes, dont know if my codes are correct