Hello, I'm trying to get a user from database users with admin field of Y, to be directed to page a, and admin field of N to go to page b. I'm failing at this.

bunch of variables up here...

$sql = "SELECT * FROM $tbl_name WHERE username='$username' AND password='$password' AND admin='$admin' LIMIT 1";
$run = mysql_query($sql);
$count = mysql_num_rows($run);


if ($count > 0) && ($admin = Y) {
$_SESSION['user'] = $username;
$_SESSION['admin'] = $admin;
header('Location: admincp.php');
exit();
}

elseif ($count > 0) && ($admin = N) {
$_SESSION['user'] = $username;
header('Location: membercp.php');
exit();
}

else {
header('Location: home.php');
exit();
}

then admin Y page checks if session user and admin is filled
and admin N page checks if session user is filled. The code on those pages are right(i think), but It's probably my method of going about this is wrong.