i am also working with simon on this project and am equally as stuck.
Using your first code you posted, it worked a treat.
ie, if i had 1 person booked on row 1, and wanted to book 4, it would return row 2, seats a, b, c and d. Which it should.
But....
If i wanted to book 2, or 3 more, ontop of the 1 person already booked in, it would return row 1, seats a, b, c, etc.
It doesnt seem to be missing out seat a for some reason.
This is what i have:
<?php
$seat = $_POST['seat'];
$time = $_POST['time'];
$query1 = "SELECT time, row_number, Count(seat) AS Count, booked FROM rollercoaster
GROUP BY time, row_number, booked
HAVING (((time)='".$time."') AND ((Count(seat))>='".$seat."') AND ((booked)=0))
ORDER BY time, row_number
LIMIT 1";
$result = mysql_query($query1);
$record = mysql_fetch_array($result);
$num_rows = mysql_num_rows($result);
$query2 = "SELECT * FROM rollercoaster WHERE time='".$time."' AND row_number='".$record['row_number']."' LIMIT $seat" ;
$result2 = mysql_query($query2);
echo $record['row_number'];
while ($record2 = mysql_fetch_array($result2))
{
$seat = $record2['seat'];
?>
Any ideas why its doing this?