Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Another Pagination Question!


Is it possible to make pagination from outputs from a while statement. If it is, then how?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
PHP Pagination
I would like my customers to be able to navigate between pages like, PREV 1 2 3 4 5 NEXT etc. I have managed to get this working using a combination of code created with dreamweavermx and by following the tutorial at php freaks. However i need the first page that loads to be page 1, so that the first link to be displayed will be for page 2. I'm nearly there but need a bit of help to overcome this. I have enclosed the code below as im not sure where to go from here.
Any help would be much appreciated.
Many thanks.
A working link
http://www.textual-intercourse.co.uk/pagination3.php


<?php require_once(); ?>
<?php
$currentPage = $HTTP_SERVER_VARS["PHP_SELF"];

$maxRows_Recordset1 = 15;
$pageNum_Recordset1 = 0;
if (isset($HTTP_GET_VARS['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $HTTP_GET_VARS['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db();
$query_Recordset1 = "SELECT polyphonictones.Id,Artist,TrackName,name FROM polyphonictones, ringtonegenre WHERE ringtonegenre.id = polyphonictones.Genre ORDER BY polyphonictones.Artist";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1,) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($HTTP_GET_VARS['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $HTTP_GET_VARS['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

$queryString_Recordset1 = "";
if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
$params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . implode("&", $newParams);
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php do { ?>
<?php echo $row_Recordset1['Id']; ?> <?php echo $row_Recordset1['Artist']; ?> <?php echo $row_Recordset1['TrackName']; ?> <br>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?><br>
<table width="493" height="130" border="1" align="left" cellpadding="1" cellspacing="1" bordercolor="#000000">
<tr>
<td width="485">
<?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Previous</a>
<?php } // Show if not first page ?>
<?php $totalPages_Recordset1 = $totalRows_Recordset1 / $maxRows_Recordset1;
for($i = 1; $i <= $totalPages_Recordset1; $i++){
if($i == $pageNum_Recordset1){
echo($i."&nbsp;");
}else{
echo("<a href="$PHP_SELF?pageNum_Recordset1=$i">$i</a>&nbsp;");
}
}


if(($totalRows_Recordset1 % $limit_Recordset1) != 0){
if($i == $pageNum_Recordset1){
echo($i."&nbsp;");
}else{
echo("<a href="$PHP_SELF?pageNum_Recordset1=$i">$i</a>&nbsp;");
}
} ?>
<?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Next</a>
<br>
<?php } // Show if not last page ?></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

Pagination Needs Help
I'm having trouble with pagination and haven't been able to find a site or thread to help. Here's what I'm doing:

I want to display only part of an article. The text from the field ('description')will contain hundreds of characters...I want to limit those characters at let's say...150, and display a "Read On..." link after that, that will link to a page that displays the entire article.

Pagination
I have been trying to get my pagination to work as it should. I am nearly there.

For example if I have 10 pages and the increment between them is set to one, all is well unitl I get to page 9. It should show

Prev 1 2 3 4 5 6 7 8 9 10 Next

but it misses the Next off. Any chance someone could pass their capable eyes of my code to see where I may be going wrong. It is not life threatening, just hindering me somewhat.

Cheers

##################
$filename = "test";
$page_num =9;
$s= $page_num;

//increment between pagination eg 1 2 3 next == 1
$n = 1;

$num_pages = 10;
$total_pages = $num_pages;
$e = min($s + $n - 1, $s + $num_pages - 1);

$pagin = "";
$pagin .= "<div id="options">
";
if ($s!= 1){
$previous = $s - $n;
if($previous == 1) {
$pagin .= "<A HREF="$filename.php">Previous</a>
";
}
else {
$pagin .= "<A HREF="$filename$previous.php">Previous</a>
";
}
};
for ($x = 1; $x <= ceil($num_pages/$n); $x++){
$current = ($x-1) * $n + 1;
if ($current == $s){
$pagin .= "$x
";

}else{
if($current == 1)
{
$pagin .= "<A HREF="$filename.php">$x</a>
";
}
else{
$pagin .= "<A HREF="$filename$current.php">$x</a>
";
}
};
};
if ($e + $s -1 < $total_pages){
$next = $s + $n;
$pagin .= "<A HREF="$filename$next.php">Next</a>
";
};
$pagin .= "</div>";
print "$pagin";

Pagination
Anyone have an efficient solutions for pagination? I have to display a
number of items but would like to paginate using only 10 lines of data
on each page and provide navigation at bottom.

Pagination
I have a small problem with one of my scripts, I have a pagination script and I've turn to the forum that I use and no one could help me, so I'll try this one. Let's see, my problem is a pagination script,I have this code:

Pagination
This process of paginating is breaking my brain! For the past several hours I have been following a tutorial that was not overly specific to my needs and turned out to have multiple errors in it. I have followed its process as best as I could, but it doesn't work. The script doesn't return an error, it just fails to paginate the results. Can someone give me a clue as to where I need to begin fixing this code:

Pagination
I am trying to find a really, really good pagination class that can be used to display them in multiple way's. Anyway have any they really like, or have created that I could use. I am looking for something that has a lot of features.

I always hated pagination, however after looking through classes I have found a lot that will cut down on time. Though I want to try to find one where the way you paginate can be changed around a little bit easier. Does anyone know of a really good one, that they have used.

How To Use Pagination
I have 7 columns in the table. The first 2 columns should not be changed and last 5 columns is used in pagination of columns.

How can I proceed with this.
Last 5 columns is users and when I click on NEXT the columns should change from A1 A2 A3 A4 A5 to A6 A7 A8 A9 A10. I should use pagination columnwise.

Php Pagination
I have implemented this but i seem to be having problems. When i go to the next page it changes this statement:

select * from sellproperty WHERE buylet='Buy' limit -10, 10
to this when i click on e.g. page 2.

select * from sellproperty WHERE buylet='Buy' limit 0, 10
but it does not like this statement and throws an error because it should be 10, 10 not -10, 10 i assume .

Now this is not the only problem i am having. I would have thought that when i go through the pages it would go up like so 10, 10 - 20, 10 - 30, 10 etc but page 1, 2 and 3 all say -10, 10.

My first question is how do i remove the - and also why is my code not going up in 10's? Code:

Pagination
I am running a Hot or Not program (except it isn't for people it is for painted miniatures) anyway, the user account would show all the miniature pictures uploaded and I needed a pagination to deal with this. Well I managed to get one to work (thanks by the way, all your tutorials and what not were invaluable) However, I do have one problem.

When a user access's there own account, they now see everyones miniatures that have been uploaded to the server. The images are held in a different database then the user info. What I am wondering is, how do I do the pagination so that it checks the id of the miniature image vs the id of the user so that it only displays the image that belongs to the proper user and not the whole image database.

I can post the script I have so far if needed.

McCragge

Pagination.
I've found a tutorial on pagination, seems like a decent tutorial.  However, all the tutorials i have seen on this subject, always use the "Select * FROM <table>".

My queries almost always have a Where statement inbedded into it.  How can i use my queries while still maintaining the tutorials guide, example of where my problem lies is below: Code:

Pagination
i used parts of the pagination script found on phpfreaks but have modified it abit.  So now my only issue i have is i need it to after giving me how many pages is to only display like 5 of the pages but on an upward route like

     < 1 2 3 4 5 >
   
what i want is lets say i want to limit the amount of pages in the pagination so that when i click 5 it shows me
     
     < 4 5 6 7 8 >

here is my code:

Getting A Url For Pagination
Is there a fasterway that doing a foreach($_GET) to get the 1,2,3,4 on a pagination??

Pagination
Can someone help me with my pagination ? I have used it fine before but i do not know how to impliment it on my current page.

I have a page that loops throught my database results and I want a new page to be created every 10 results. The page number is pulled from the url using $_GET Code:

Pagination
i have the following code and it all seems to work the only problem is it will only find one result, now to test i set the limit at 1 and inserted 3 fields manually it will echo one result but wont give me the option to get onto another 2 pages i echoed the total rows and it is only counting 1 any idea why? Code:

Pagination
I can display the page no problem. There are six entries in the database, I limit it to show only 2 per page. It shows Prev2 and Next 2 as well as current page on the bottom. But they do not show up as hyperlinks. Also too, this is returning that there is only 1 page, when there should be 3. Code:

Pagination
I'm trying to break a listing into pages with 10 listings per page. I have read through the pagination tutorial and is having difficulty implementing the codes. Please point me toward the correct direction. Here is the original listing code:

Pagination
I want to put a pagination on bottom of the page and I have like 100 page numbers or more, so I want to show only 5 page numbers on both sides of the current page, if u know what i mean like:

Prev .. 8 9 10 11 12 13 14 15 16 17 .. Next

when i move to the right or left then i add or subtract one. Here 's what i have so far:

for ($i = 1; $i <= $numPages; $i++) {
        echo " ";
        if ($i == $pageNum)
            echo "$i";
        else
            echo "<a href="?page=$i">$i</a>";
 }

Best Way Of Pagination.
which would you consider the best way of doing pagination?

by putting the result in a array or by using mysql.

right now i have it with mysql but i was thinking about putting all result in a array and then do the paging threw an array, but i dont know about speeds in php.

which way would be faster?

Pagination
I am having a bit of trouble getting my pagination to work correctly as there are some obstacles I have to work around in this specific script.

I have the script recognizing how many results there are, and it correctly displays the amount of pages there should be for the amount of data, but when I try to go to any other page than the first, it loses the rest of the rows and doesn't display anything.

Here is my code, I have narrowed it down as much as possible and deleted things you don't need to see so it is easier for you to look through. Code:

Pagination
Im using the pagination successfully, but now i do have quite alot of pages being given in results

eg
QuotePREV15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 NEXT15

im using the standard Code:

Pagination
I have this script which i got from PHPFreaks.com and im trying to print the results that are being shown the only way i can see doing it is like below but I cant see me coding that for every page. Has anyone got any better ideas? Code:

Pagination
i am trying to use a pagination script that is from a tutorial on here i was given a link to and basically i can get information to display on first page and it brings up standard text saying under PREV5 1 NEXT5 but it isnt a link or interactive so i cant get next 5 records or last so i have 5 records on screen but cant navigate between them.

But i cant see why the screen shows only 5 records there are no error codes can anyone see what i have done wrong please as i feel like im going round in a circle. Code:

Pagination
I have the paging script in this php file and this is for the members section of my site.

When it shows all members it works correctly with the exception of a number "1" next to the "Last" Box and I cannot figure out where that problem is.

Also I have this set up to where members can "view all members" or "view only members with avatars". When you click to view only members with avatars it shows the correct first page of members with avatars but it shows the incorrect members with avatars count from the database and when you click another page it snaps back to the viewing all members pages.

I have attached a picture of what it looks like and here is the php code....

Pagination + While Statements = ???
How would I do that? I've added pagination to some of my scripts before,, but I always used if statements for that.. how to do it in while statements?

Pagination With MySQL
Well it's extremely early on Saturday morning and, well....I'm bored. :)

Anyway, there have been some questions about Pagination with MySQL, so I decided to write up something real quick. I believe the comments within the code explain it all.

Please excuse me if there are any typos...I'm tired ;)


<?php

/*
Check whether the 'page' GET variable is not defined or equals zero.
In either case, an error is sent and the script terminated.
*/

if(empty($_GET['page'])) {
echo 'Page number is not defined!'
exit();
}

/*
The following makes sure that the 'page' variable only contains numbers,
therefore limiting it to just integers(whole numbers).
*/

else if(!preg_match("/^([0-9])+$/",$_GET['page'])) {
echo 'Page is not a valid value!'
exit();
}

/*
If the 'num' GET variable isn't defined in the URI, then the var num_per_page is by default set to 10.
This utilizes the ternary operator. After the check for existence, then there is a check to make sure that
the string contains only an integer using the same method as above.
*/

$num_per_page = (empty($_GET['num']))? 10 : $_GET['num'];
if(!preg_match("/^([0-9])+$/",$num_per_page)) {
echo 'Num is not a valid value!'
exit();
}
//Get the page number from the URI; the pages start when page=1, not page=0
$page = $_GET['page'];

/*
Connect to database and then select a database.
You can also include this information if you want, but this is just an example ;)
*/

$link = mysql_connect('localhost','username','password');
mysql_select_db('database');

/*
This piece is the essence of pagination. Using LIMIT in the mysql query is what we are going
to use for this. The following line creates a new variable, qPage, which is the value of the
page number minus one times the number of rows you want to show up on each page.
For example, if page = 1 in the URI, then 1-1*10 = 0. This is the offset for the LIMIT in the query.
If page = 2then 2-1*10 = 10. Since 10 is the number per page in the example, then it only makes sense
to start the next limit at an offset of 10.
*/

$qPage = (($page-1)*$num_per_page);

/*
The following is the query of the pagination; this is where the magic takes place.
the SELECT is self-explanatory. The LIMIT is the most important. LIMIT has the syntax
LIMIT [offset],[length]. Knowing this format you should be able to follow the query now.
Now for the following you are probably wondering why I added 1 to the value for the number per page.
I did this simply to know if there is going to be another page after the current one. We will need this
information later when we are echoing out the 'Next page' link.

Note: You may want to change the query to fit your needs, however the LIMIT clause should stay the same.
Everything else can be changed :)
*/

$query = "SELECT * FROM `table` ORDER BY `col_name` ASC LIMIT ".$qPage.",".($num_per_page+1);
//You should remove the 'die(mysql_error());' part of the following after development
$result = mysql_query($query) or die(mysql_error());

/*
Here 'num' is set to the number of rows that the above query returned. The condition simply
sees if the number of rows returned equals zero, because if it does than that means that there
are no more rows for the specified LIMIT.
*/

$num = mysql_num_rows($result);
if($num == 0) {
echo 'No more results!'
exit();
}

/*
Here's is another interesting part. At first thought one may want to use a while loop here.
The only problem with the while loop is that it echos that last row that we selected in the
query when we don't want it to. Instead of handling this it's easier to use a for loop
instead, using the num_per_page variable as shown. Obviously you can format the HTML and PHP
output however you'd like; I'm just outputting the array as an example.
*/

for($i = 0; $i < $num_per_page; $i++) {
$row = mysql_fetch_array($result);
echo '<pre>'
print_r($row);
echo '</pre>'
}
mysql_close($link); //Close the link to the MySQL database.

/*
This goes back to selecting that extra row in the query. If the amount selected (num) is
greater than the number per page(num_per_page) than that means that there is at least one more
row to be returned after the the range that you want, therefore you know you can echo the 'Next Page'
link without having to worry if you are linking to a blank page or not.

The rest should be self-explanatory. If you are going onto the next page, you are going to increment the
page variable by one, and of course you still want to keep the current number per page otherwise you may
see repeats, so you just echo that value in it's corresponding place within the url query.
*/

if($num > $num_per_page) {
echo '<a href="index.php?page='.($page+1).'&num='.$num_per_page.'">Next Page</a>'
}
echo '<br/>' //Just acts as a separator for the two links ;)

/*
The following acts the same way as above, however instead of incrementing you are subtracting one from the
page variable to 'go back' to the previous page. Obviously you do not want to 'go back' when you are on the first page
to begin with, so we first check to make sure that the page value is larger than &#391;' (our first page) before we start
echoing it to the browser.
*/

if($page > 1) {
echo '<a href="index.php?page='.($page-1).'&num='.$num_per_page.'">Previous Page</a>'
}

?>


There are also many other related threads on this topic. Here's a few:
http://www.webmasterworld.com/forum88/5119.htm
http://www.webmasterworld.com/forum88/2880.htm
http://www.webmasterworld.com/php/3088021.htm
http://www.webmasterworld.com/forum88/9755.htm
http://www.webmasterworld.com/forum88/4255.htm
http://www.webmasterworld.com/forum88/6510.htm
http://www.webmasterworld.com/forum88/11904.htm


If anyone can add something, please do. I know I'm missing something ;)

Pagination Problem
I try to make a pagination system work on a page of results that come from a form. The results get fine to the results page (with the right limit specification, but I am unable to pass the following results to next page. I think the problem could be on two places:

Or I made a mistake in my form which looks like this:

Paginating (pagination)
it seems that the next button is ok but the previous button does not go to the write page but it goes to itself. it is a basic question and answer database with each q&a showing up on a single page. PHP Code:

Pagination With PHP & MSSQL
I know this is a PHP mailing and i'm sorry that my first post is
mainly to do with MSSQL but i'm after a method of pagination with
MSSQL data and PHP.

There seems to be an endless amount of scripts and methods with MySQL
and the limit function but i'm yet to find a method with MSSQL that
doesn't involve PEAR (apparently it's not allowed to be installed on
the server!)

Pagination Through Database
I have some pages that will be spitting out information from a database with live 1500 lines of entries and I would like to paginate each page to LIMIT the output for 50 queries each page. I am having trouble doing a LIMIT loop with my queries. Anyone got some good tips?

Pagination Solution
how to createa pagination just like the one in vBulletin. Yesterday, I asked a question about making sure that I get 10 pages per page, even though some of the things get deleted. I went back to work on that right now, and I can't imagine how easy it is - it's logical too!! I present my solution for those who MIGHT want to know. PHP Code:

Pagination Code
First off, hello to everyone, its my first time here and after reading some helpful googled forum posts about other difficulties I was having that came up from this site, I thought i would join.

Heres my current situation, Im working on a site learning PHP as i go with manuals, reading sites online etc, Ive done ok so far and I'm learning a lot. I've come to a bit of a hurdle tho at this point.

------------------------------------------------------------------------
Pagination, Using a tutorial on the internet I am close to having it working but I have hit a snag. Here is the situation. I have got a search page that passes on these variables :

Keep Variables In Pagination
i'm trying to set pagination for a search i run on my website, i'll
try to explain the easiest i can:

When i click the search button on search.php, data is received and
stored in variables within results.php, MySQL structure seems to work
as expected, although i get some problems:

As soon as i click on the "Page 2" Link, i get nothing, neither results
nor page numbers.

I know why this happens: after clicking on any "Page X" link, the page
self-reloads and this changes the stored value in the VARIABLES (i
assume to 0 or nothing), therefore, MySQL structure doesn't work, since
there's no correct data to set the query.

Stating the obvious, if i set a fixed value instead of a variable my
structure perfectly works:

Pagination Problem
I've got one of those problems that you know the problem is simple, but
you've been staring at it for too long to make sense anymore.
Basically, I have the following function to help step through a database
by displaying Previous and Next links, depending on some variable sent
to it.....

Finding Pagination
First, let me say this is NOT a "How do I paginate my results?" question. I know how that works. Problem: I have items that are listed by date and medium. Both have paginated listings for searching for items. What I need to do is go back to either list to the page where the current item is listed.

Say item #10 is listed on page 1 of dates, and page 5 of mediums [simplified for illustration]. I want the user to be able to come from dates - then move to the mediums listings, while finding the item just viewed on the resulting page.

To determine the mediums listing I tried a function where I looped through a pagination function looking for the $id of the item in the result set with in_array(). It would only return the highest page number, if it returned anything. I have really trashed the function, and have to start from scratch. It seems my logic is wrong. Code:

Advanced PHP Pagination
Is there anyone who could help me create an advanced pagination code? The basic:

1. Data to paginate will be coming from msyql database.
2. 10 or 20 items per page.
etc, etc...

The problem: Limit the number of page numbers to 5 when pages reach more than 5 pages.

Example: Total pages: 10

sample page listing output:

start of pagination
1.) << 1 2 3 4 5  >>

displayed when last page number is clicked (5) on start of pagination
2.) << 3 4 5 6 7 >>

Page Pagination?
My script is only showing the first 10 results on every page that my page declares. Basically I have 5 pages and the script shows that correctly on the browser, but when I click on the link to go to page 2 my script pulls up the same results. Can some one help with my coding? Code:

View All Plus Pagination?
i have a online store that has about 2800+ products  - on my productList.php pages I have a few variables to display the number of products per page:

<?php
$productsPerRow = 3;
$productsPerPage = 27;my boss would like a view all button that sets $productsPerPage to the total number of products  - and is active for as long as the SESSION (Perhaps unless the button is clicked again?)

Any Ideas on the best approach to accomplish this??

MySQL Pagination
Does anybody know how to control the number of page links displayed with pagination?  I mean like, with the tutorial on this site, if I had, say 50 pages of results, it actually creates individual links for page 1-50.  How could I make it truncate say 1-5, and then an arrow to goto 6-11 and vice versa? Here is the code the tutorial uses

    for($i = 1; $i <= $numofpages; $i++){
        if($i == $page){
            echo($i." ");
        }else{
            echo("<a href="$PHP_SELF?page=$i">$i</a> ");
        }
    }

Pagination System?
I have had a system I have been re-using for pagination for a long time. I originally created it, and was rather happy with how well it worked. Basically:
<p>Click thumbnail for larger view.</p> Code:

Pagination Option
Below (A) is a portion of my pagination code where I specify the limit. What I'd like to do is add a select function (B) that will allow users to specify the limit. On change of select option, it should refresh with the new limit: Code:

Pagination Of 2 Tables
I have 2 tables - one of these tables contains an index type structure of reference numbers. From this list of reference numbers, I pull those which match certain WHERE criterea. Then I run a query on the 2nd table and pull data from it where the reference number matches, but again this has WHERE criterea relevant to values in the 2nd table.

The only problem is this...pagination works fine until it jumps into pulling data from the second table. It is set to pull out 6 results in total for a page, so I pull out 6 results from the first table.

This is where the problem comes because then the search in the second table is only within these 6 results, and so can return anywhere from 0 to 6 results (it returns only results which pass the 1st query for table 1, then narrows them based on the type using data in the second table.

To better illustrate - you have a tube of smarties, you pull out 6 blue ones as you only want 6. Then you get rid of any that are chipped and give the ones left to your mate (pft, as if. e-numbers are for me!!!)

Obviously my pagination method is completely wrong!

So yeah, my pages don't always return 6 results if the search criterea is to specific, as it only searches within 6 results at a time because I want it paginated.

Anyone got any ideas on how I can solve this problem so that I always have 6 results being output on the page?

(Btw, if this is too confusing let me know and I'll try to explain better. Makes sense to me, but then I'm the one who's asking the question!)

Here's my code:

PHP Pagination With Classes
I am using the PEAR excel reader to read an excel file. I made a class to handle the interaction with the EXCEL class that I downloaded.  I want to print the results of the Excel file but using pagination. This is not an easy task. I will add the main file and the class. Code:

Specific Pagination !
I've got some regular joe schmoe queries running ... now the totally result of these queries goes well over 2,000 records. Im looking to paginate these in a certain fashion :

<< Prev 1   2   3   4   5   6   7   8   9  10  Next >>

Each # obviously will display the page ! but Prev and Next will jump to either previous 10 or next 10... so if im on page 4 and i hit next ! i dont want to go to page 5 but rather page 11 and display:

<< Prev 11   12    13   14   15  16  17   18   19  20  Next >>

I hope this is doable ! if not please give me a better suggestion, a more effective and/or efficient way to be able to browse through all these records.

Column Pagination
I have a problem in pagination of columns. 5 columns should be displayed in a page. Help me in displaying the rows based on columns. All the columns are displayed in first page. Code:

Pagination Script
I'm looking for an easy to understand, easy to implement pagination script for PHP.  I've used a script by Evolt before but have run into some problems.

My main challenge this time is that it needs to join two tables and paginate the the results.

Pagination Tutorial
I followed the pagination tutorial provided on the site and everything worked out perfect... then it hit me. If I use this tutorial to display my articles, the order will be backwards. My oldest article will always be first. I see there is a comments section at the end of the tutorial and I can see that someone already tried to address that issue.

I just can't get the comments to show up. I only see their titles. Can someone either explain how to see the comments at the end of the tutorial or possibly post the solution here?

Pagination Lynx
Attached is the code for a page that goes through the database and creates pagination lynx on the page. but it only seems to work when i run it on my pc, but as soon as i upload it it only displays the first record and not the pagination lynx. Code:

MySQL Pagination Loop
Senario: I would like to display at all times four images taken from mySQL database into a table cell. Lets say I have 6 imgs total - page 1 would display img 1 - 4 and on page 2 it displays imgs 5 & 6. (I have no problem with a normal pagination) When I reach img6, I would like it to add imgs 1 & 2 in the next 2 cells, this is to keep my 4 images displayed. As you press next page, it cycles thru the 6 images and at all times displaying 4 images.


Copyright © 2005-08 www.BigResource.com, All rights reserved