Salve a tutti,ho un piccolo problema che mi sta facendo sbattere la testa da parecchi giorni,e cioè,ho il seguente codice php

include('../db.php');
session_start();
if (isset($HTTP_POST_VARS["usr"])){
$user=$HTTP_POST_VARS["usr"];
$pass=$HTTP_POST_VARS["pwd"];

$qry=mssql_query("SELECT * FROM utenti WHERE user = '$user'") or die ("Query Fallita");


if ($row=mssql_fetch_array($qry)){
if ($row['accfaill']<="5"){
if($row['password']==$pass){
$qry=mssql_query("UPDATE utenti Set accfaill = '0' where user='$user'") or die ("Query Fallita");

$_SESSION['user']=$user;
$_SESSION['password']=$pass;
$_SESSION['id']=$row['id'];


}else{
$qry=mssql_query("UPDATE utenti Set accfaill = accfaill + 1 where user='$user'") or die ("Query Fallita");
$_SESSION['msg']="Login Errato!";

}
}else{$_SESSION['msg']="L'account potrebbe essere bloccato,contattare l'aministratore!";
}
}else{$_SESSION['msg']= "Login Errato!";

}
}
inserito in una pagina chiamata login.php,quando io gli invio i dati col metodo post lei li riceve e dovrebbe elaborarli,ma invece non fa nulla e mi restituisce subito il msg che io gl'ho impostato e cioè
}else{$_SESSION['msg']= "Login Errato!";
secondo me non riesce a filtrare i dati nel database sql tramite la query
$qry=mssql_query("SELECT * FROM utenti WHERE user = '$user'") or die ("Query Fallita");


if ($row=mssql_fetch_array($qry)){
per voi che può essere?io ho provato a togliere where (si no restituisce i dati)però funziona.

Scusate se sono stato poco chiaro

grazie anticipatamente