0

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.

Edited by Dani: Formatting fixed

Attachments result.JPG 2.6 KB
3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by pritaeas
0

If you don't put an effort into describing the problem no one will put an effort into solving it. What error message are you getting? It would also help if you used the code tags.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.