Skip to content
Advertisement

Difference between where and like in CLEARDB

I’m trying a simple nodejs login system and want to use the following query:

But it simply doesn’t return anything so I had to do it like this:

This is the code segment:

Can anyone point out why the first query is not working?

And the difference bertween the two statements?

N.B: This is the first time i’m using cleardb on heroku and a few things seems different from MySql. Everything else in the code works so I’ve narrowed the problem down

EDIT 1

I just noticed that the second query is running even though the password was wrong

UPDATE 1 Here is the node js code as requested:

And here is the post request from ReactJs:

Advertisement

Answer

Use:

Tip: never use LIKE for authentication queries and try to encrypt passwords.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement