title: PHP MySQLi Query between two times from the query itself
body: <p>I basically having trouble finding out how I can get both "starttime" and "endtime" from the query I'm querying so it displays the data from the database between the times from the event. </p>
  
  <p>MYSQL Query</p>
  
  <pre><code>$resultEvents = mysqli_query($con,"SELECT * FROM events WHERE starttime &gt;= (SELECT starttime FROM events) and endtime &lt;= (SELECT endtime FROM events)");
  </code></pre>
  
  <p>PHP Display</p>
  
  <pre><code>&lt;?php 
          while($events = mysqli_fetch_array($resultEvents)){
                  echo '&lt;div id="eventnotification"&gt;';
                  echo '&lt;a href="./events/' . $events[1] . '"&gt;&lt;div class="enc-' . $events[2] . '"&gt;';
                  echo '&lt;h5 class="notificationtitle"&gt;' . $events[3] . '&lt;/h5&gt;';
                  echo $events[4];
                  echo '&lt;/div&gt;&lt;/a&gt;';
                  echo '&lt;/div&gt;';
              }
           ?&gt;
  </code></pre>
  
  <p>In the database table called <code>events</code>, there are:</p>
  
  <ul>
  <li>id<br /></li>
  <li>eventname<br /></li>
  <li>title<br /></li>
  <li>description<br /></li>
  <li>article<br /></li>
  <li>creator<br /></li>
  <li>starttime<br /></li>
  <li>endtime<br /></li>
  </ul>
  
  <p>Selected data from the row are displayed on the page, but only between the starttime and enddate from that row is displayed, else, it won't be displayed.</p>