Page 1 of 1

How can I select tariff in database depending on the date?

Posted: Wed May 24, 2006 11:23 pm
by z_cool
hi everyone,

Am a web developper in eco-tourism and i've just start to create database driver
website, where peoples can have a free quote to come on holiday in my country.
My problem is that, when someone request a quote after s/he has filled the quotation form. My php script need to check the arrival date when peoples will come. As in the hotel there's two seasons; one low and the other high. These two seasons have different prices. If s/he come in the low season the script give s/he the low prices else if s/he come in the high season s/he will have high prices.

Is there someone who can help please??

How can I select tariff in database depending on the date?

Posted: Thu May 25, 2006 12:10 am
by z_cool
hi..

There's nobody who can help me on that issue?

Posted: Thu May 25, 2006 4:53 am
by JayBird
Its fairly easy.

Store both sets of prices in a table

Then...

Psuedo code

Code: Select all

// Check current date

if( date > arrivalDate)
{
    // select one set of prices
} else {
    //select other set of prices
}
NOTE: Please DO NOT bump a post half and hour after posting your question!! :twisted:

Posted: Thu May 25, 2006 6:07 am
by JayBird
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:3. Do not make multiple, identical posts. This is viewed as spam and will be deleted.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:4. All users of any level are restricted to bumping (as defined here) any given thread within twenty-four (24) hours of its last post. Non-trivial posts are not considered bumping. A bump post found in violation will be deleted, and you may or may not recieve a warning. Persons bumping excessively be considered as spammers and dealt with accordingly.