This is my codes i dont think there is something wrong with my query but i keep getting this error "mysql_num_rows() expects parameter 1 to be resource, boolean given in" i checked my database to make sure nothing is spelled wrong and the quotation marks but still this error
if(isset($_POST['e_username']) && isset($_POST['e_password'])){
$e_username = preg_replace('#[^A-Za-z0-9]#i','', $_POST['e_username']);
$e_password = preg_replace('#[^A-Za-z0-9]#i','',$_POST['e_password']);
$e_password_md5 = md5($e_password);
$sql = @mysql_query("SELECT * FROM employee_db WHERE username='$e_username' AND password ='$e_password_md5' LIMIT 1") || die("Unable to run query".mysql_error());
$userCount = mysql_num_rows($sql);
if ($userCount == 1){
$_SESSION['e_username'] = $e_username;
header("Location:profile.php");
exit();
}else{
//echo "<div class =\"error\">Incorrect Infomation Register --------></div>";
}
}