hi folks,

my reservation table is as below.

tbl_holiday_booking

booking_id
property_id
checkin_date
checkout date

i am taking checkin and checkout date as dd/mm/yyyy

please hellp me to check availability for the property in the above table.

Thanks

I guess you will have some bunch of html select elements for the user to select the checkin and the checkout dates.
After the form submit just check all the validation is done properly by the javascript or else some bugs like checkout date>checkin date,
after that select query to check the db and then other processing.
just do

if(isset($_POST['bt']) && $_POST['btn'] !='')
{
//form the dates here
$chkinDay = $_POST['chkinDay_select_name'];
$chkinMonth = $_POST['chkinMonth_select_name'];
$chkinyr = $_POST['chkinYr_select_name'];

$chkoutDay = $_POST['chkoutDay_select_name'];
$chkoutMonth = $_POST['chkoutMonth_select_name'];
$chkoutyr = $_POST['chkoutYr_select_name'];
$sql = mysql_query("select * from tblname where chckindate<='".$yourFormedDate."' and chkoutDate >='".$yourFormedDate"' ");
if(mysql_num_rows($sql) > 0){
//data available do something
while(mysql_fetch_query($sql))
{
//do something with the fetched data
}
}
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.