title: Booking Dates Availability Ranges in PHP/MySQL
body: <p>I have two fields, check_in and nights.</p>
  
  <p>Nights are inclusive of the check_in date. So if a customer books 1 night, he would then check_out the following day and the room would then be available for booking (unless already booked by somebody else).</p>
  
  <p>Here is an example of a couple records within my table,</p>
  
  <pre><code>customer          room            check_in            nights
  cus1              test room       2013-01-23          2
  cus2              test room       2013-01-25          1
  cus3              test room       2013-01-26          4
  </code></pre>
  
  <p>cus3 has booked a room, they will check into the room on 2013-01-26 and they will stay for 4 nights. this means the room will be unavailable for booking during this time.</p>
  
  <p>So how would I check whether the room was available?</p>
  
  <p>the room should only be available for check_in on 2013-01-30.</p>
  
  <p>All help is appreciated :)</p>