well you pretty much have the right idea.
Heres what I would do:
$selectthedate = $_POST['selectdate'];
$selecttheweeks = $_POST['selectweeks'];
$query="SELECT * FROM table WHERE date ='". $_POST['selectdate'] . "' and availability = 'available'";
$result=mysql_query($query);
if(!$result){
echo("error with query.");
exit;
}
if(mysql_num_rows($result)==0){
echo("No bookings...");
exit;
}
$row=mysql_fetch_array($result);
echo($row['date']." is ".$row['available']." Book now!";
As for the date up to for weeks. I have done this before but I am not sure how you are using your dates. But the query would be somthing likehtis
$query="SELECT * FROM yourtable WHERE date>=".$date1." AND date<=".$date2;
Hope this helps. 
__________________
Please login or register to view this content. Registration is FREE - 100 Satisfied Customers - Custom Programming and Web Development
|