title: how can calculate the total price for 5 days (mysql ) hotel booking system
body: <p>I have this table for the price of rooms with diffrent season ( high , low ) season</p>
  
  <p>how can get total price for 5 days with diffrent days and diffrent season ..</p>
  
  <p>look at this table</p>
  
  <p><img src="https://i.stack.imgur.com/YIi99.png" alt="enter image description here"></p>
  
  <p>this is my command ( mysql )
  I want to get the total price for 10 nights from  <strong>04-07-2013</strong>  to <strong>11-07-2013</strong> </p>
  
  <pre><code>select sum(
  case when dayname('2013-01-07') = 'Monday' then coalesce(prices.room_price , def.room_price) 
   when dayname('2013-01-07') = 'Sunday' then coalesce(prices.room_price , def.room_price) 
  
  )as TotalPrice 
  from (select strtodate('2013-01-07' , '%Y-%m-%d') as thedate 
  select strtodate('2013-01-08' , '%Y-%m-%d') as thedate ) dates left outer join ts_room_prices prices
  on dates.thedate between prices.season_start and prices.season_end cross join ts_room prices def on def.season_name = 'default'
  </code></pre>
  
  <hr>
  
  <hr>
  
  <h2>addition</h2>
  
  <p>I wrote this command but still dosen't work </p>
  
  <pre><code>select sum(coalesce(prices.room_price , def.room_price) ) as TotalPrice
  from (select strtodate('2013-01-07' , '%Y-%m-%d') as thedate union all
        select strtodate('2013-01-08' , '%Y-%m-%d') as thedate
       ) dates left outer join
       ts_room_prices prices
       on dates.thedate between prices.season_start and prices.season_end and
          dayname(dates.thedate) = prices.dayofweek join ts_room_prices def
      on def.season_name = 'default' and
         def.hotel = 3233 and
         def.dayofweek = dayname(dates.thedate)
  </code></pre>
  
  <p><strong><em>Error: #1305 - FUNCTION saudihot_saudihotels.strtodate does not exist</em></strong></p>