0

I inserted into user_name and user_password the values zach and sha1('zach'). I then tried to retrieve it with SELECT * FROM user_data WHERE user_name='zach' && user_password=SHA1('zach');

But it shows zero results. When I insert it it shows, but I can't retrieve it. Any ideas?

2
Contributors
5
Replies
19
Views
1 Year
Discussion Span
Last Post by vivosmith
0

Through sql. I tried through php, but qhwn I tried mysqli_num_rows, it kept coming to zero. I tried myphpadmin and the username worked but password did not. I tried multiple times, but it kept acting like this. Idk what is up. I simply INSERT INTO userdata (user_name, user_data) VALUES ('zach', SHA1('zach')); .

0

I also tried this and it did not work:

SELECT * FROM user_data WHERE user_name='mat' AND user_password=sha1('mat');
0

Can you show your table structure? If the password column isn't long enough (< 40) then the hashed password gets truncated and can never be retrieved because it won't match anymore.

Edited by pritaeas

This question has already been answered. 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.