$sql = "Select * from ' Links ' WHERE ' subdomain '! = '" ORDER by id desc LIMIT "; $rows = $db->getdata ($sql); foreach ($r oWS as $row) {echo '
'. $row [' title ']. '';}
The first page of the article call I will write, but to pagination do not know how to write
There is now a field title subdomain
Reply to discussion (solution)
Just find a page function to apply it.
The approximate parameters are as follows:
1 Total
2 Current Page
3 Quantity per page
4 BaseUrl, the title and the subdomain you say are sent in get mode.
5 Display number of pages
Class Ccustomwidgets {public static function Pager ($totalPages, $pageNumber, $pageSize, $url, $displayNumber = 6) {$ BASEURL = (Strpos ($url, "?") = = = = False)? $url. '? Page= ': $url. ' &page= '; $pager = '
'; $prevPage = $pageNumber-1; if ($prevPage > 0) {$pager. = '
- ĸ?�页
'; } if ($totalPages-$pageNumber < $displayNumber) {$displayStart = ($totalPages >= $displayNumber)? ($totalPages-$displayNumber + 1): 1; $displayEnd = $totalPages; }else{if ($pageNumber% $displayNumber) {$displayStart = Floor ($pageNumber/$displayNumber) * $displayNumber + 1; $displayEnd = (Floor ($pageNumber/$displayNumber) + 1) * $displayNumber; }else{$displayStart = (Floor (($pageNumber/$displayNumber)-1) * $displayNumber + 1; $displayEnd = (Floor ($pageNumber/$displayNumber)) * $displayNumber; }} for (; $displayStart <= $displayEnd; $displayStart + +) {$pager. = '
- '. $displayStart. '
'; } if ($pageNumber < $totalPages) {$pager. = '
- ĸ?�页
'; } $pager. = "
"; return $pager; }}
If your paging is to be done on the database, these two fields are not enough, you only have the title and part of the article. At least you have to identify this domain is the first paragraph/page of the article and the ID title of the identity article can be repeated
Is the complexity of paging logic.
The main use of SQL Limi statement to page, pass two parameters, a start page, a display number per page.
At the front desk, if you don't use a brushless, you can use the address get value to the page, and then change the content based on the value of get.
Do a brushless, $.post the page number to action, and then handle it in action.
The callback function then replaces the DIV content.