displaying a table of results

I have a client booking system. each client has their own profile. the user table is called booking_user and the booking table is called booking_event. In the clients profile it should echo all of the days in which they are booked in, it should also show what time.

At the moment it is only displaying ONE day and time they are booked in for, can anyone help?

below is the code I have so far

[php]<?php

$rsss = mysql_query(“SELECT * FROM booking_event WHERE user_id = '”.$cid."’");
$r2 = mysql_fetch_array($rsss);

?>

<?php echo $r2['time_slot'];?> <?php echo $r2['meridiem'];?> <?php echo $r2['day'];?>[/php]

would I be able to achieve this with some sort of loop?

never mind

sorted it :slight_smile:

[php] <?php
$query = “SELECT * FROM booking_event WHERE user_id = '”.$cid."’";
$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result)){
echo $row[‘time_slot’]. $row[‘meridiem’]. " - ". $row[‘day’];
echo “
”;
}

?>[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service