|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||||
|
|||||
|
Next and Previous Links using Functions
I have been working on this for a while, trying to simplify previous and next links using functions. So here it is, Please let me know how it works for you.
Basic Rundown This script can pull information from MySQL Database and let you use Previous and Next Links to navigate. All you have to do is set the configuration info at the top of the script and setup the SELECT statement and the rows. This also works well using include from another php file. UPDATED 09/11/2006 6:12 Removed gpageNum function and added it in with recordPaging(). Fixed problem with results with only 2 pages. Added Comments Updated Record Paging Added Not displaying links when its not needed. php Code:
|
|
#2
|
|||
|
|||
|
RE: Next and Previous Links using Functions
not bad.. i think there is room for improvement. specifically:
- you might want to make sure that your query string for what page you're on doesn't interfere with any other query string variables.. - you might consider displaying page numbers, allowing people to jump 2 or 3 pages ahead, rather than forcing them to go one page at a time. or allow the developer to choose between several different displays. either way don't force the developer into using a table, try style sheets. - don't link back to the page you're currently viewing - i think you should allow the functions to be portable with both databases as well as flat-files. some commenting in your code would be nice too. |
|
#3
|
|||
|
|||
|
RE: Next and Previous Links using Functions
I thought about several of those improvement options that you mentioned right after I posted this. I will be adding to this code soon. I just wanted people to have a better option of using next and previous links than what is posted in the tutorial section.
I am also open for any additional code that anyone might think will be usefull. |
|
#4
|
|||
|
|||
|
RE: Next and Previous Links using Functions
funny, i sent a pm to bluephoenix a week or two ago talking about revising/updating the prev-next link tutorials
still haven't heard back. |
|
#5
|
||||
|