Re: determine date range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, December 12, 2007 10:39 am, slith wrote:
> I'm working on hotel type booking script where prices will vary
> depending on the season. prices are updated every year so i need to
> take
> a user inputed date and determine which season the date falls under.

I would highly recommend adding a table like:

create table price (
  price_id int(11) unsigned autoincrement unique not null primary key,
  startdate date,
  enddate date,
  price int(11) unsigned
);

Then INSERT a new price for any seasonal variations.

You can then base the price on the date for advance bookings by
looking up the price by date, and NOT quote a price for a reservation
so far in advance that they aren't willing to honor it...

You may need to have some admin and make sure the startdate/enddate
always "makes sense" as the hotel adds data, but at least you'll KNOW
what the price is supposed to be for any given date, instead of just
trying to pretend you know when you don't...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux