-1

i try to retrieve password from database to check the login process and check password is match or not

for insert data i try

$sql = "insert into users values ('".strval($_POST["UserName"])."' , MD5('".strval($_POST["Password"])."'))";

and for get data i try

$sql_check_login = "select * from users where username = '".strval($_POST["UserName"])."' and password = MD5('".strval($_POST["Password"])."')";

can any one help me to fix this error because the password did not match thanks

  • 1
    Does this answer your question? [Trouble with PHP and Mysql queries using md5 encryption](https://stackoverflow.com/questions/5007489/trouble-with-php-and-mysql-queries-using-md5-encryption) – Avi Dec 11 '19 at 08:30

1 Answers1

0

the problem wasn't in the code the problem in the length in the database can not store the hole value of MD5 hash when i store the data So, i increase the length and it work fine.