Jump to content

Show more


fife

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.