title: MySql query where any date between two dates is between two dates
body: <p>I have a MySQL Datatable with an ID, two datetime and a boolean column.</p>
  
  <p>Looks like this:</p>
  
  <pre><code>CREATE TABLE `Example` (
   `ID` int(11) NOT NULL AUTO_INCREMENT,
   `Date1` date NOT NULL,
   `Date2` date NOT NULL,
   `Answered` tinyint(1) DEFAULT NULL,
   PRIMARY KEY (`ID`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8
  </code></pre>
  
  <p>Now I have a startdate and an enddate, and I need a sql query which gives me that rows, where <strong>any</strong> <strong>day</strong> <strong>between</strong> the <strong>startdate</strong> and the <strong>enddate</strong> is <strong>between</strong> <strong>Date1</strong> and <strong>Date2</strong>! </p>
  
  <p>What works is that query, wich gives me those rows, where the <strong>Date1</strong> is <strong>between</strong> the <strong>startdate</strong> and the <strong>enddate</strong> and <strong>Aswered</strong> <strong>= 1</strong>:</p>
  
  <pre><code>    $proof = "select * from Example where Date1 
      between '$startdate' and '$enddate' and Answered = 1";
  </code></pre>
  
  <p>But I dont know how to do that with all dates between two dates</p>
  
  <p>Thanks for help!</p>