I have a table Orders that holds information about the rental date range and the price for a car rental.
The price is given by:
SELECT ROUND((points * (SELECT DATEDIFF('$dateTo', '$dateFrom'))) * 0.95) AS price
$dateTo
and $dateFrom
are PHP variables that holds the value of a given date range by the user. In others words:
$dateTo = $_POST['date-to'];
$dateFrom = $_POST['date-from'];
So for each day you are given 5% off from the rental price, but I also want to check if the date range goes across a Saturday or a Sunday. If the rental is from Friday to Monday, I want to add an extra 10 points to the total price because the date range includes a Saturday.
Is this possible?