title: How to select rows if given date is between two dates?
body: <p>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.</p>
  
  <p>If it is possible I need also to do condition inside  the query </p>
  
  <pre><code>$coursneededdate &gt;= startdate AND $coursneededdate &lt;= enddate
  </code></pre>
  
  <p>Here is my code, any help would be highly appreciated. </p>
  
  <pre><code>$coursneededdate = '2020-08-27';
  $sql = "SELECT * FROM curriculum where ".$coursneededdate." between  'startdate' and 'enddate'";
  $result = $mysqli-&gt;query($sql);
  if ($result-&gt;num_rows &gt; 0) {
  
  
      while($row = $result-&gt;fetch_assoc()) {
  
  echo $row["curriculum_id"];
  
  
      }
  }
  </code></pre>