Jump to content


Photo

Problem with foreach loop?


  • Please log in to reply
No replies to this topic

#1 jenny kaur

jenny kaur
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 June 2006 - 07:51 AM


This is my db

+----+------------+--------------+--------------+----------+
| id | bookdate   | Enddate      | Room_number  |   Guest  |
+----+------------+--------------+--------------+----------+
| 1  | 1149609600 | 1149695999   |       1      |   Jones  |
+----+------------+--------------+--------------+----------+
| 1  | 1149523200 | 1149609599   |       1      |   Smith  |
+----+------------+--------------+--------------+----------+



below is my code

<?php




[code]

This is what i get output on screen  

+---------+------------+------------+-----------+
| Room #  | 06/05/2006 |06/06/2006  |06/07/2006 |
+---------+------------+------------+-----------+
|     1   |            |   Jones    |           |      
+---------+------------+------------+-----------+
|     1   |   Smith    |            |           |
+---------+------------+------------+-----------+


i am trying to get room 1 displayed once and Smith and Jones in the same row. like this:

+---------+------------+------------+-----------+
| Room #  | 06/05/2006 |06/06/2006  |06/07/2006 |
+---------+------------+------------+-----------+
|     1   | Smith      |   Jones    |           |      
+---------+------------+------------+-----------+



can someone tell me where i am going wrong?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users