Finding out the first possible booking date with php

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

 



Hello everybody,

I am pretty much stuck with a problem and I was hoping to find some help here with you guys.

A PHP Script with MySQL as DB has to find out the first possible booking period available. I can't figure out the logic behind and if there is a trick with PHP to do it.

Following facts:
- There can only be 3 bookings in the same time period
- I want to find out the first period available
- There should be a less as possible periods that are unbooked

Example:
Start	End
1.12	14.12
4.12	18.12
5.12	19.12
In this example the first possible booking would be 14.12 - 28.12 as this is a time period where I can offer a place that holds a max of 3 bookings.

My Problem now is how to pull this info and process it?

Should I get all dates out of the DB and process them via PHP, or do a magical MYSQL Query (which by the way seems not to be possible in that case in my knowledge) ?

Let's asume we go with PHP. Has somebody an idea how to form that kind of logic?

Thank you for ANY help,

merlin

--
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