I am attempting to retrieve a list of all future dates that have been inserted into my MYSQL table.
Example: I have inserted the values 8-16-14, 8-27-16, 8-17-17. The issue is that the below code returns all of the values and not just the future ones.
Any ideas why this is not working?
public function getUpcomingDate($id) {
$date = date('m-d-y');
$stmt = $this->conn->prepare("SELECT * FROM roles WHERE id = ? AND item_date > '$date'");
$stmt->bind_param("i", $id);
$stmt->execute();
$user = $stmt->get_result();
$row_count = $user->num_rows;
while ($row = $user->fetch_assoc()) {
$data[] = $row;
}
$stmt->close();
if($data) {
return $data;
} else {
return false;
}
}