, ...
- - , - -
. - , ...
- :) ,
( ,
. ).
Google .
, ... ,
,
, -
000.
15 () :)
... , -
. , ,
60 10
"1 2 3 ..."
, "LIMIT"
. ,
. , ,
... Google ;)
...
.
,
SQL,
- -
"
-----" (, 7
) ... :(
, - ,
( -
),
-
. !
, :
,
! PHP,
. "next
page". - "next"
-
, ..
, ( "next"
).
:
- "" - (
) (
, , .)
- "" - :)
"".
<?
$total_articles_number = 79; //
$articles_per_page=10; //
//
$total_pages = ceil($total_articles_number/$articles_per_page);
// -
for ($i=0; $i<$total_pages; $i++){
// $from ( $page_number)
$page_number=$i*$articles_per_page;
// $page_number ( $from ) ,
// $from $page_number
if ($page_number!=$from) echo "<a href='".$PHP_SELF."?from=".$page_number."'> ".($i+1)." </a>";
// - ,
//
else echo $i+1; // page_number - - ( )
}
?>
, - "1
2
3 4 5 6 7 8", URL ( ,
"") :
https://localhost/ep/ep.php?from=20.
, , "3"
from=20
20-.
, , $from
.
(, , :), -
. (
) ( ;)
, 10 ,
$from.
:
,
""
""
- $from. .. $from=20
21 30 (
$articles_per_page)
- :) -
;)
as RWinner winner@2winners.com
RWinner
. ,
( footer). ,
,