Is there any problem wid ths code?
$name=$_POST['txtusername'];
$password=$_POST['txtpw'];
$result = mysql_query("SELECT username,pw FROM login");
while($row = mysql_fetch_array($result))
{
if($name=$row['username'] && $password=$row['pw'])
$valid_user = 1;
else
$valid_user = 0;
}
if($valid_user=1)
echo "You are logged in";
else
echo "Enter again";