fife Posted January 11, 2011 Share Posted January 11, 2011 Hi I have made a view all albums page for my website and I want it to only show 10 records. If there are more than 10 I would like a next or previous button to appear and for them to take you to the next 10 records or previous 10 records. Please can somebody show me where I can learn how to do this? I know it has something to do with msql_num_rows so I have a variable called $numrows I'll post the code I currently have here <form name="view_all_albums_frm" id="view_all_albums_frm"> <table width="793" border="0" cellspacing="5" id="all_albums_tbl" cellpadding="0"> <tr> <th scope="col">ID</th> <th scope="col">Album</th> <th scope="col">Album Description</th> <th scope="col">Edit</th> <th scope="col">Delete</th> </tr> <tr> <?php $qGetAlbums = ("SELECT * FROM albums ORDER BY `id` asc"); $rGetAlbums = mysql_query($qGetAlbums) or die(mysql_error()); $numrows = mysql_num_rows($rGetAlbums); while($AllAlbums = mysql_fetch_assoc($rGetAlbums)) { ?> <th height="26" scope="col"><?php echo $AllAlbums['id']; ?></th> <th height="26" scope="col"><?php echo $AllAlbums['album_name']; ?></th> <th scope="col"><?php echo $AllAlbums['album_description']; ?></th> <th scope="col"> </th> <th scope="col"> </th> </tr> <?php } ?> </table> </form> Link to comment https://forums.phpfreaks.com/topic/224087-show-more/ Share on other sites More sharing options...
Rifts Posted January 11, 2011 Share Posted January 11, 2011 you want pagination http://www.phpeasystep.com/phptu/29.html easy guide Link to comment https://forums.phpfreaks.com/topic/224087-show-more/#findComment-1157907 Share on other sites More sharing options...
litebearer Posted January 11, 2011 Share Posted January 11, 2011 This PHP Freaks tutorial may be what you need... http://www.phpfreaks.com/tutorial/basic-pagination LOL slow typist here! Link to comment https://forums.phpfreaks.com/topic/224087-show-more/#findComment-1157908 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.