![]() |
Limit MySQL result per page
Hi... I need some help over here... attached is my coding that will display all the result in a single page. I need to limit the result let say to 50 results per page. Anybody can help me out here? Million thanks in advance... :thumbsup:
Code:
<?php |
use LIMIT
$query = "SELECT * FROM defaulter WHERE NamaMajikan IS NOT NULL LIMIT 50"; |
thanks for your reply mate... but to my understanding, that will only show 50 results, am i right...
my concern is let say it will show 300 results, it will display 50 results in first page and another 50 results in all other page... that means all together will be 6 pages :D |
Then just use pagination and limit the number of pages.
|
And here you have a great example of how to do pagination:
http://www.codingforums.com/showthread.php?t=151398 |
Its pretty simple.
In your query: SELECT * FROM `blah` LIMIT Start, Amount Start = the number of rows where to start (typically page id * amount) Amount = How many results u want displayed. Typically 10 |
| All times are GMT +1. The time now is 03:39 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.