Jump to content

Arranging An Array


Rachel

Recommended Posts

Is there anyway to arrange an array like:

 

Monday 12.00 14.00 16.00

Tuesday 12.00 14.00 16.00 etc

 

instead of

Monday 12.00

Monday 14.00

Monday 16.00

Tuesday 12.00

Tuesday 14.00

Tuesday 16.00 etc

 

$sql4 = "select * from time_list where loc_id = $location_id and film_id = $film_id order by day asc";
		$result4=mysql_query($sql4);

while($rows4=mysql_fetch_array($result4)){
			$time_id = $rows4['time_id'];

<?php echo $rows4['day']; ?></td>

<td><a href ="seating.php?cine=<?php echo $location_id; ?>&film=<?php echo $film_id; ?>&time=<?php echo $time_id; ?>"><?php echo $rows4['time']; }?>

 

Thank you

 

Link to comment
Share on other sites

Big thanks, that woked how I wanted it to, but is there any way to order by time as the times are out of order?

 

eg.

friday 14.00 16.00 12.00

monday 14.00 12.00 16.00

saturday 16.00 14.00 12.00

sunday 14.00 16.00 12.00

thursday 14.00 12.00 16.00

tuesday 14.00 16.00 12.00

wednesday 12.00 16.00 14.00

 

Thankyou.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.