I am working with Dreamweaver MX and PHP/SQL.
Is there a way to skip the first 2 rows returned from the recordset?
For Example:
If the recordset returns: 1,2,3,4,5,6,7,8,9,10. Is there a way to skip the fist 2 and start displaying rows from 3 onwards?
I want to use this on a news index page. The first two articles displayed on the page would be in a larger font and have a photo.
The rest would be display in a list of titles below that. These would be from a different recordset. Obviously I don’t want to display the articles twice so I need to skip the first two.
I understand from other posts on the net that I could use ‘substr’ but I don’t know how to go about it.
I have read the part in the PHP manual but I’m still none the wiser.
I have experimented without success. Can some kind soul explain how I would go about adding substr to the code below? I *think* you exchange it for ‘echo’?
The code on the page is:
<?php do { ?>
<a href="/view.php?id=<?php echo $row_Headlines['id']; ?>"><?php echo $row_Headlines['title']; ?></a>
<?php } while ($row_Headlines = mysql_fetch_assoc($Headlines)); ?>
Many Thanks
Is there a way to skip the first 2 rows returned from the recordset?
For Example:
If the recordset returns: 1,2,3,4,5,6,7,8,9,10. Is there a way to skip the fist 2 and start displaying rows from 3 onwards?
I want to use this on a news index page. The first two articles displayed on the page would be in a larger font and have a photo.
The rest would be display in a list of titles below that. These would be from a different recordset. Obviously I don’t want to display the articles twice so I need to skip the first two.
I understand from other posts on the net that I could use ‘substr’ but I don’t know how to go about it.
I have read the part in the PHP manual but I’m still none the wiser.
I have experimented without success. Can some kind soul explain how I would go about adding substr to the code below? I *think* you exchange it for ‘echo’?
The code on the page is:
<?php do { ?>
<a href="/view.php?id=<?php echo $row_Headlines['id']; ?>"><?php echo $row_Headlines['title']; ?></a>
<?php } while ($row_Headlines = mysql_fetch_assoc($Headlines)); ?>
Many Thanks