title: how to get a value from db when searched date falls in between from_date and to_date mysql
body: <p>I have a table which has costs for rooms based on <code>from_date</code> and <code>to_date</code>:</p>
  
  <p>Format of db:</p>
  
  <pre><code>planid | roomtype_id | capacity_id | hotel_id |date_from | date_to | cost
  </code></pre>
  
  <p>and I want to get the cost of room based on arrival date which is stored in a input field when the <code>arrival_date</code> falls in between <code>date_from</code> and <code>date_to</code></p>
  
  <p>My code: </p>
  
  <pre><code>$result1 = mysql_query("SELECT * FROM room_price WHERE roomtype_id = '$roomtype_id' AND capacity_id = '$capacity_id' AND hotel_id = '$hotel_id' AND date_from '$date' BETWEEN date_from AND date_to");
  </code></pre>
  
  <p>The query doesn't gives any output.</p>