Login Form help !

hey guys need help
I need to make login form
so please tell me how to check my username field & password field from database(mysql) in Login Button Action Event

If data <> Nil Then
While Not data.EOF
if UsernameField.text=data.field(“login_name”).StringValue and PassField.Text =data.Field(“login_password”).StringValue then
MsgBox "WELCOME " + data.Field(“login_name”).StringValue

  else
    MsgBox "incorrect"
    
  end if
  data.MoveNext
wend
data.close

end if

m using this code but problem is it goes into infinte loop
plz help

Oh no! Do you store paswords in clear text?

didn’t get You!

no no ,password field is not visible to user
only one can see in database

Seriously, stop what you’re doing. You need to learn a few things about password security first. I have a couple resources for you, admittedly both authored by myself.

This article will explain a good way to store and validate passwords.
https://thezaz.com/blog/xojo/storing_passwords_securely_wit/

And here is some ready-to-use code you can use to implement what is described in the article above.
https://thezaz.com/code/authenticationkit/

There are many ways to store and validate passwords, so you don’t need to take my work as gospel or anything like that. But do not try to invent your own.

Thanks Thom! Your links are very helpful!

Question:
Your solution uses two tables: Users & Passwords. Do you recommend that these be used exclusively for the authentication?
…or, for example, is there any reason against adding columns to the Users table to store other basic user-profile data (real names, contact details, etc.).

Your user table can be anything you like. Go ahead, add columns. But for passwords, keep it simple. Less data means less chance for an attacker to determine which ones are bogus.