Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Login Script to match Username/Password in MySQL database table

I have connected to a MySQL database through API Express. The MySQL table contains user info (name, address, username, password, etc..).

When App user enters Username & Password in Login page on my App I would like to check the MySQL table records for a match. If there is a match, then user is directed to a page on the App. If no match, then login error message.

Is there a script to check for a match?

Thank you in advance.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Login Script to match Username/Password in MySQL database table

Hello Ed,

You can use simple MySQL query "SELECT", and check result on the event success. If server's response is empty - user is not found, else - user signed-in successfully.

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Login Script to match Username/Password in MySQL database table

Thank you Sergiy!

Would you happen to have a sample script that I can follow? Thanks.

Julian De La Rosa
Posts: 0
Joined: Sat Apr 19, 2014 12:28 am

Login Script to match Username/Password in MySQL database table

Just use the mapping to hold

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Login Script to match Username/Password in MySQL database table

Don't quite follow.

Hopefully, Sergiy has a sample script that I can use.

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Login Script to match Username/Password in MySQL database table

Thanks Sergiy.

I was able to setup the SQL SELECT query. Thanks!

How would I go about doing the following? Do I need a script?

"check result on the event success. If server's response is empty - user is not found, else - user signed-in successfully"

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Login Script to match Username/Password in MySQL database table

Hello Sergiy,

After setting up the SQL SELECT query through API Express what is the next step to validate Login? Can you provide the steps. Will I need a script? If so, do you have an example? Thanks.

Ed
Posts: 0
Joined: Wed May 13, 2015 6:14 pm

Login Script to match Username/Password in MySQL database table

Hello,

Can you provide a sample JAVASCRIPT for Login Validation to use on my App login page (that will validate Usernames & Passwords stored in MySQL Database)? Thanks.

bb78520
Posts: 0
Joined: Sat Apr 12, 2014 7:30 pm

Login Script to match Username/Password in MySQL database table

I am following this thread and would like to see more details as well

Return to “Issues”