Start recordset with 2nd record

message from peopel on 16 Jul 2004
DWMX2004, PHP/MySQL

I need to be able to retrieve a recordset , but start it with the 2nd record
found. Maybe if I explain what my project is, it'll be clearer.

I have a calendar of events that pulls records from a database. On the main
calendar page, I'd like to show the full record for the most recent event
(calling that rsEvents1), including the date, title, description, contact, etc.
Further down the page, I'd like to list the rest of the upcoming events (I'm
assuming a new Recordset I'll call rsEvents2), which will just be dates and
titles, with a link to the details of the event.

How do I create this 2nd Recordset (rsEvents2) so that it starts with the 2nd
record?

Here is my basic code for the original recordset.
<?php
mysql_select_db($database_connCayuga, $connCayuga);
$query_rsEvents1 = "SELECT * FROM events WHERE endd >= NOW() ORDER BY
`startd`, `endd` ASC";
$rsEvents1 = mysql_query($query_rsEvents1, $connCayuga) or die(mysql_error());
$row_rsEvents1 = mysql_fetch_assoc($rsEvents1);
$totalRows_rsEvents1 = mysql_num_rows($rsEvents1);
?>
 
Joaquim Lopes replied to peopel on 16 Jul 2004
<?php do { ?>
whatever we have to do
<?php } while ($row_db = mysql_fetch_assoc($ourdatabase)); ?>

To start with the second record you fetch a record ($dicarded_record =
mysql_fetch_assoc($ourdatabase)) and then proceed happily to your while loop.
Hope this helps.
 
Gary White replied to peopel on 16 Jul 2004
Is the query the same for both? If so, why bother with a second recordset?

Gary
 

Archived message: Start recordset with 2nd record (Macromedia Dreamweaver)