hi all,

i am trying to create a room booking system in php.

now i want to check if a period exists within a given month.

i ask the user for the month and how many days they want to come, now i want to look in mysql (where i have every date of the year, with a status code 9=unavailable 1= available)
if there s a period available in the month they have given.

if for example a user says i want to come 4 days in november 2010, how would i go in my query with this?

thanks a lot!

You need to be more specific about what you are looking for. Assuming that the following dates are free (status==1):
2010-11-02 through 2010-11-10
2010-11-16 through 2010-11-20

and the person plans to stay for 4 days, are you looking for a two element array that states:
2-10
16-20

or ALL the possible ranges:
2-5
3-6
4-7
5-8
6-9
7-10
16-19
17-20
etc

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.