Is it possible for people to have the same username? Probably not, so why the WHILE loop?
Anyway, make sure that the field you are comparing against is actually the password field, by fetching the assoc-array instead of just a row, and by comparing against $row['password'] (if indeed the column is named "password")
<?
while ($row = mysql_fetch_assoc($result))
{
$encpass = md5($password);
if($encpass == $row['password']) {
echo('You have successfully logged in as ');
echo($user);
echo('<BR> With pass: ');
echo($encpass);
} else {
echo('Bad Password...');
};
};
?>