i want to hash the registered password in the database using MD5 and the same thing when login but the problem is that in the register process the password get hashed but in the login the system work as this is incorrect password
register.php
//ADD MD5 hash to the password
$db_pass=md5($pass1);
//************Insert all the user's input to the database**************************//
$query = mysql_query("INSERT INTO user(user_name, first_name, last_name, governorate,
district, village, birth_date, email_address, specialization, password,
registered_date)VALUES('$username', '$firstname', '$lastname', '$governorate',
'$district', '$village', '$bdate', '$email', '$specialization', '$db_pass',
now())") or die("could not insert data");
login.php
$pass = md5($pass);
$sql=mysql_query( "SELECT user_id, email_address, first_name, user_name FROM user
WHERE email_address='$email'
AND password='$pass'LIMIT 1") or die("error in user table");