Comparing Inputs with table' columns not table data in SQL Query used in nodejs

Viewed 21

I've designed the login frontend with react-native and backend with NodeJS. I'm using SQL Query to check if input username and password exists in database. Instead of checking inputs with table data, it is checking inputs with column names. The SQL Query used is:

    await request.query(`SELECT username FROM dbo.loginusers WHERE username=${username} and password=${password}`,

I tried every possible way to do this but no change. If I use username as 'username' and password as 'password' then it is logging in. But I want to use the table data to log in.

Thankyou in advance...

0 Answers
Related