As a matter of fact, you never need to count anything. This step is just redundant.
If you give it a bit of a thought, you can simply fetch your data first and then use it in the condition. What is much more important, you must use a parameterized query. So the code should be
$stmt = $mysqli->prepare("SELECT * FROM isalonusers WHERE user_id=?");
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_result();
// here goes your problem with "count"
$row = $result->fetch_array(MYSQLI_ASSOC)
if($row) {
$username = $row['username'];
$password = $row['password'];
}
Neither should you use that terrible practice with or die