table roomBooking:
roomBookingID roomID bookingDate startTime endTime glID
numberOfPeople staffID
table room:
roomID typeOfRoom roomState
php code:
<?php require_once('../config/conn.php');
$sql="SELECT * FROM roomBooking, room WHERE roomState='empty'";
$rs=mysql_query($sql,$conn);
$row_rs = mysql_fetch_assoc($rs);
$count=mysql_num_rows($rs);
?>
...
<table border="0">
<?php do { ?>
<tr>
<td>
<?php echo $row_rs['roomID']; ?>
</td>
<td>
<?php printf('<a href="action/roomDetail.php?roomID=%s">詳情</a>',$row_rs['roomID']);
?>
</td>
<td>
<?php printf('<a href="BookingManagement.php?roomID=%s">預約</a>',$row_rs['roomID']);
?>
</td>
</tr>
<?php }while ($row_rs = mysql_fetch_assoc($rs));?>
</table>
I want to list out all roomID in table roomBooking where roomState in table room is empty but the result is wrong.It's supposed to show 5 and 87 respectively.