title: How to check availability room reservation between check in and check out?
body: <p>need your help to check availability on room reservation. for the ilustration I have a tabel which have 3 coloumns such as room_number (varchar), check_in (date), check_out (date).</p>
  
  <p>Then that table have one record data : 1212, 2014-04-19, 2014-04-22. Then in my PHP program I want to check availability in the same room number with Check in date = 2014-04-20 and Check Out date = 2014-04-23.</p>
  
  <p>To check the room availability I use this query :</p>
  
  <pre><code>    select * from apartment where room_number = '$room_number' and ((date_in &gt;= '2014-04-20' and date_out &lt;= '2014-04-23') or (date_in &lt;= '2014-04-20' and date_out &gt;= '2014-04-23'));
  </code></pre>
  
  <p>According that date, supposed to be show the recorded data before in that table, but that query not show it and my PHP application still showing the message that that room still available to reserved. What is the correct query? Need your help.</p>