I want to echo the results of this mysql query
SELECT username, task_completed FROM accounts WHERE referrer_by = :referrer_by AND task_completed < 1
I have this code so far but this doesnt return anything and it should return the values which are less than 1
$ref_query=$db->prepare("SELECT username, task_completed FROM accounts WHERE referrer_by = :referrer_by AND task_completed < 1");
$ref_query->bindValue(":referrer_by", $user);
$result = $ref_query->execute();
if($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<br> Username: " . $row["username"] . " - Tasks: " . $row["task_completed"] . " <br>";
}
}