Ok, Thanks NoEffinWay, that did not completely solve the problem, but it certainly made things better. Now instead of getting a blank screen after I run the search I am at least getting something. So thanks, now let me update everyone. My code now is written as follows:
<?php
$link = mysql_connect("mysql", "USERNAME", "PASSWORD");
mysql_select_db("asianbeachhouse booking");
if (!$link)
{
die('Could not connect: ' . mysql_error());
}
else
{
$Query = mysql_query("SELECT Count( reservation.RoomID ) AS CountOfRoomID,
reservation.RoomID
FROM reservation
WHERE ((((reservation.RDate) >= $checkindate)
AND ((reservation.RDate) <= $checkoutdate))
AND ((reservation.Availability) = 'Vacant'))
GROUP BY reservation.RoomID;
$RAvail = mysqli_query($link,$Query);
$NumResAvail = mysqli_num_rows($RAvail)");
echo "<b>$NumResAvail Rooms Available</b>";
?>
<table border="1">
<tr>
<th>Count of RoomID</th>
<th>RoomID</th>
</tr>
<?php
while ($Row = mysqli_fetch_assoc($RAvail))
{
echo '<tr>';
echo '<td>' . $Row['CountOfRoomID'] . '</td>';
echo '<td>' . $Row['RoomID'] . '</td>';
echo '</tr>';
}
?>
</table>
<?php
mysqli_free_result($RAvail);
mysql_close($link);
}
?>
You can see what the results is by logging onto my website at www.asianbeachhouse.com. My goal is to have a system that has condo information stored in a database and it allows the user to select the dates of their vacation and then search for available condos to rent in the area. Right now I am working on the search part of this website, with the following query. It searches the reservation table which holds the following fields. ID, RoomID, Reservation date as RDate, and Availability. My query is going to search this Table for available rooms on or between the check in and check out date. Compare the count of those rooms with the difference between the check in/check out date + 1 and this should produce a list of Room IDs that is available for the full time. Once I get this query working I will add in my final criteria which will be comparing the date diff function I created to the count of rooms as I stated above.