Gomi
Gomi

Reputation: 662

Using MD5 in MySQL

I want to use hash to verify email existence. I've tried this code and it somehow doesn't work. Is there any mistake or should I look elsewhere?

The code:

SELECT id FROM users WHERE MD5(email+'*salt*')='*some value*' AND checked='0'

Upvotes: 0

Views: 66

Answers (1)

Carsten
Carsten

Reputation: 18446

You don't use + to concatenate strings. You use CONCAT:

SELECT id FROM users WHERE MD5(CONCAT(email,'*salt*'))='*some value*' AND checked='0'

Upvotes: 2

Related Questions