Try changing your code to below.
if($result)
{
//echo "Successfully deleted".$id;
$count=mysqli_num_rows($result);
//echo $count;
if($count==1)
{
$_SESSION['userName']= $userName;
$_SESSION['passWord'] = $passWord;
header("location:users.php");
}
else
{
header("location:index.php");
}
}