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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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