$perPage = 20; if (is_numeric($_REQUEST['page'])) { $page = (int) $_REQUEST['page']; if ($page < 1) { $page = 1; } } else { $page = 1; } $start = ($page - 1) * $perPage; $query = 'SELECT [fields] FROM [table] ' . "WHERE [condition] LIMIT $start, $perPage"; $result = mysql_query($query); while ($record = mysql_fetch_srray($result)) { // wyswietlanie wpisow } $prev = $page - 1; $next = $page + 1; $prevLink = $_SERVER['PHP_SELF'] . '?page=' . $prev; $nextLink = $_SERVER['PHP_SELF'] . '?page=' . $next; echo "<p align='center'>", "<a href='$prevLink'>"; "Previous Page</a> | ", "<a href='$nextLink'>", "Next Page</a></p>";