Jump to content

Recommended Posts

Hi. I have read the tutorial on paginaiton on PHPfreaks tutorials, but I sitll  dont get it.

 

Can someone paginate

 

<?php 
include('Connect.php');
include('top.php');
$result = mysql_query("SELECT * FROM pokemon_info ORDER BY pokemon_level DESC");
     while($row = mysql_fetch_array($result)){
echo "<table border='1' height='20' width='400' bgcolor='lightgrey'>";
echo "<th><b>User ID: </b><br /></th><th><b>Level:  </b><br /></th><th><b>Icon: </b></th><th>Pokemon Name:</th>";
echo "<tr>";
echo "<tr><td><a href='viewprofile.php?id=" . $row['user_id'] .  "'>" . $row['user_id'] . "</a></td><td><a href='viewparty.php?id=" . $row['user_id'] .  "'>" . $row['pokemon_level'] . "</a></td><td><a href='viewparty.php?id=" . $row['user_id'] . "'><img border='0' src='" . $row['pokemon_icon'] . "'></a></td><td><a href='viewprofile.php?id=" . $row['user_id'] .  "'>" . $row['pokemon_name'] . "</a></td><td>"."\n";
echo "</table>";
}
include('bottom.php');
?>

 

For me for future reference? If not can someone help me? Thanks in advanced.

Link to comment
https://forums.phpfreaks.com/topic/83673-pagination/
Share on other sites

Well, these forums are here for us to help you help yourself. If we did it for you then you will just be back here next time asking us to do something for you because you couldn't take the time to learn how to do it.

 

That being said, I will be happy to help you work through this problem. Let's start with the first block of code:

 

<?php
    $limit      = 25;                
    // Sets how many results shown per page 
     
    $query_count    = "SELECT count(*) FROM table";     
    // Sets what we want to pull from the database 
    // count(*) is better for large databases (thanks Greg!) 
     
    $result_count   = mysql_query($query_count);     
    // Pulls what we want from the database 
     
    $totalrows  = mysql_num_rows($result_count);     
    // This counts the number of users 
?>

 

What part of that do you not understand? For the parts you do understand, please modify it to your needs and post it. Once we get that worked out we will move on to the next block of code.

Link to comment
https://forums.phpfreaks.com/topic/83673-pagination/#findComment-425717
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.