Pagination

Discussion in 'PHP' started by papa_face, Dec 10, 2006.

Thread Status:
Not open for further replies.
  1. #1
    Hello,
    Could anyone help me work pagination into this script?
    <?php
    
    require("includes/connect.php");
    
    $id = $_GET["cat"];
    
    $selectcat = mysql_query("select title,author,description,article,category from article where category='".$id."'",$con);
    
    while (list($title,$author,$description,$article,$cat) = mysql_fetch_array($selectcat))
    	{
    	print '<table width="85%" border="1">';
    	print '<tr><td class="viewfilestitle">Title:</td>';
    	print '<td class="viewfilesdetails">' . $title . '</td></tr>';
    	print '<tr><td class="viewfilestitle">Author:</td>';
    	print '<td class="viewfilesdetails">' . $author . '</td></tr>';
    	print '<tr><td class="viewfilestitle">Description:</td>';
    	print '<td class="viewfilesdetails">' . $description. '</td></tr>';
    	print '<tr><td class="viewfilestitle">Article:</td>';
    	print '<td class="viewfilesdetails"><pre>' . $article . '</pre></td></tr>';
    	print '<tr><td class="viewfilestitle">Category:</td>';
    	print '<td class="viewfilesdetails">' . $cat . '</td></tr>';
    	print '</table><br>';
    	}
    
    ?>
    
    Code (markup):
    I've looked at tutorials on the internet for pagination but I cant work out how to apply the same methods to the above script. Any help would be greatly appreciated.

    regards
     
    papa_face, Dec 10, 2006 IP
  2. Fl1p

    Fl1p Active Member

    Messages:
    511
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Ok you have to provide us with more information, are you getting any errors when you used that code?
     
    Fl1p, Dec 10, 2006 IP
  3. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    #3
    No I didnt get any errors. I have worked out how to do it now. Thanks for the reply.

    regards
     
    papa_face, Dec 10, 2006 IP
  4. TheGuy

    TheGuy Peon

    Messages:
    138
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
  5. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I was about to mention a snippet for doing that :rolleyes:
     
    Pat Gael, Dec 10, 2006 IP
Thread Status:
Not open for further replies.