Function check_data(ByVal username As String, ByVal password As String) As String
Dim sqlcon As New MySqlConnection
Dim sqlcmd As New MySqlCommand
Dim constr, strsql As String
Dim response As String
constr = "Server=localhost;User Id=root; Password=2456; Database=gamedb; Pooling=false"
sqlcon.ConnectionString = constr
sqlcon.Open()
Dim inNumRows As Integer
strsql = "SELECT * FROM account WHERE username = '" & username & "' AND password = '" & password & "' "
MsgBox(strsql)
sqlcmd = New MySqlCommand(strsql, sqlcon)
inNumRows = sqlcmd.ExecuteScalar()
If inNumRows > 0 Then
response = "Success Login"
Else
response = "Error Login"
End If
sqlcon.Close()
sqlcon = Nothing
Return response
End Function