Php > Algorithms
Paginating the mySQL data
Paginating the mySQL data = $tenthPages ) { $back10Position = $startPos - $tenthPages ; $pageString .= '
<<
'; } if($startPos >= $rowsPerPage) { $backPosition = $startPos - $rowsPerPage; $pageString .= '
Back
'; } if($totalRows != '') { $page = ceil($startPos / $rowsPerPage); $pageCount = $page + $numPages; $PageNo = ceil($startPos / $rowsPerPage ) ; // echo ' Page No ' . $PageNo ; for($i = 1,$pgCnt=1; $page <= $pageCount; $i = $i + $rowsPerPage) { if ( $PageNo == $pgCnt ) { $pageString .= '
'.$pgCnt.'
'; $pgCnt++; } elseif ($i < $totalRows) { $pageString .= '
'.$pgCnt.'
'; $pgCnt++; }; $page++; }; } $nextPosition = $startPos + $rowsPerPage; if($totalRows == '') { $pageString .= '
Next
'; } elseif($startPos < $totalRows ) { If ( $nextPosition < $totalRows ) { $pageString .= '
Next
'; } } if($startPos < $totalRows ) { $next10Position = $startPos + $tenthPages ; If($next10Position < $totalRows ) { $next10Position = $startPos + $tenthPages ; $pageString .= '
>>
'; } } return $pageString; } ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage