For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > November 2004 > how to implement "pages" of results









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to implement "pages" of results
Ragan Davis

2004-11-24, 8:55 pm

Hi,

I'm sure this is a common question, so please forgive if it's been posted before.

I have a select statement that selects records from a table:
"select * from $table where host='$somename'"

I then propagate a table with the returned data. My goal is to only display 30 records per "page", with links on each page that take the user to the next and previous 30 records. I have played around with using "limit", but this seems to only get me the
next 30. How to achieve the previous 30? It would be easy if the records returned were sequentially numbered...but, since I'm being selective in which records I return (host=$somename), this is not the case. The first row may be 1, and the second row
may be 10, etc.

Anyone have any ideas on how to solve this?

Thanks!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com