hi all,
i have table and it have a thousand of rows or data and to make it net and clear to a user, i put a limit in 100 as row. but how can i do to view other data?
table limit
Moderator: General Moderators
Re: table limit
Pagination. Use an offset with your limit.
Code: Select all
$limit = 100;
$offset = ($_GET['page'] - 1) * $limit;
$query = "Blah blah whatever LIMIT $offset, $limit";Re: table limit
Thank for this and where should i put this code as you show up above.
Re: table limit
It's probably best if you do some research on the concept of pagination, as it's generally a larger concept than is suitable for a forum post.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: table limit
Thank for this and where should i put this code as you show up above.
If it is a paging,you can put it in the top of the page , for example:
Code: Select all
<?php
//any code
?>
<html>
<head></head>
<body></body>
</html>
if your code is include loops or something like loop(foreach,for,while..exc..) you must put it in the right place , In the top of the page(like the previous example) or any place that match your full code!...
i wish i helped you,if not,,someone else may help you