0

I have a small desktop application created, i wan to create a login function for this. i have a database using MySQL which stores user name and password. i wan to know how to compare the user name and password entered in the text field with the data in the database.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by cale.macdonald
0

I have a small desktop application created, i wan to create a login function for this. i have a database using MySQL which stores user name and password. i wan to know how to compare the user name and password entered in the text field with the data in the database.

There are a few steps you need to do in order to complete this.

1) Make a connection to the database
2) Create a query trying to find the required information from the required table (possibly login?) based off of the supplied username/password
a) if a record is returned then the user exists
3) display a message.

Building your query as a hard coded string could pose some problems with SQL injection techniques, however once you have information you want from the database you can address that hole.

If you run into problems post your code and we can help out.

Cheers

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.