Hi
DO NOT STORE USERNAME AND PASS IN A COOKIE!!! (BIG security risk when the coockies is stored on user-system, and not destroyed!! Instead, try storing $status = "loggedin")
So, that having said:
$result = "Select * from table where username = '$username' and password = '$password'";
if (mysql_num_rows($result) > 0)
{
echo "Oh yeah! You can enter this site";
}
else
{
echo "Don't even think about getting in! You are not a user!";
}