-1

Im quite new in mysql

I have inserted values into my table customer

INSERT INTO customer(f_name, l_name, mobilehp, username, password)
VALUES
('Ahmad', 'Ali', '013-5404997', 'A_Ali', SHA('something'));

Then I inserted a condition,

select customer_id, f_name FROM customer WHERE password=SHA('something');

However the query returned empty set which is weird when it supposed to display customer_id and f_name. So any help would be greatly appreciated. Thanks

1 Answers1

-1

Do not use sha1 for passwords. Use password_hash or other crypto algorithm. sha1 is unsecure.

select customer_id, f_name, password FROM customer WHERE f_name = 'Ahmad';

Then check password.

See comments in links https://www.php.net/manual/en/function.password-hash.php https://www.php.net/manual/en/function.password-verify