I'm trying to select rows if the given date only falls between two dates in the table In the curriculum table I have startdate and enddate.
If it is possible I need also to do condition inside the query
$coursneededdate >= startdate AND $coursneededdate <= enddate
Here is my code, any help would be highly appreciated.
$coursneededdate = '2020-08-27';
$sql = "SELECT * FROM curriculum where ".$coursneededdate." between 'startdate' and 'enddate'";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["curriculum_id"];
}
}