[thelist] PHP paging code problem

Eric R Mills emills at wackyworld.tv
Wed Apr 20 10:21:28 CDT 2005


using code at the following link:

http://www.evolt.org/article/Multiple_Pages_With_PHP/17/19340/

I have edited it to pull info from my database and I have tweaked the
html to have the results displayed how I want it, but other than that I
have not messed with it too much.  

However, I am wondering just what this code is looking for in the way of
"$query" variable?  I have it defined as "SELECT * from table1 ORDER BY
last_name ASC" and this should run using $page and $limit variables,
giving me the output I am looking for (FYI: this query is in response to
a button click called "List All" so I do not want any conditional output
i.e. WHERE x = y).  

Upon initial running of the script (when user clicks "List All" on the
preceding page) the first ten records are displayed and all of the
paging info is displayed properly. There are 60 records so the upper
left shows "Results 1-10 of 60" and the upper right shows "Page 1 of 6".
So far so good.  Just below that shows "Results per page 5 | 20 | 30 |
50" (each number is a hyperlink).  Then my table appears and just below
that shows "1 2 3 4 5 6 next" (again, each of these is a hyperlink).
When I hover my mouse over any of these links the address bar at the
bottom of my browser page shows the link info and all is correct ($page
and $limit variables are plugged in as they should be).

The problem is this:  when I click on any of these links, the page
reloads, but the output data does not change.  The address bar at the
top of the browser page shows that the $page/$limit variables have
incremented, but only the first ten records appear on the screen. Its as
if the page reloads but the code does not loop again and recount using
the new variable value.    Please help with any assistance you can lend.

I have attached my code (with changes) to help you understand this.

Thank you,

Eric Mills
Wacky World Studios, LLC  


More information about the thelist mailing list