man12_patil3 Posted September 16, 2011 Share Posted September 16, 2011 Select * from tabName Limit 25 by above query i get 25 rows than i want to add Limit in this result for pagination 5 record per page . How it is possible ?? Quote Link to comment https://forums.phpfreaks.com/topic/247273-how-to-apply-limit-on-result-of-records/ Share on other sites More sharing options...
AyKay47 Posted September 16, 2011 Share Posted September 16, 2011 this site has a nice tutorial on pagination.. http://www.phpfreaks.com/tutorial/basic-pagination Quote Link to comment https://forums.phpfreaks.com/topic/247273-how-to-apply-limit-on-result-of-records/#findComment-1269905 Share on other sites More sharing options...
web_craftsman Posted September 16, 2011 Share Posted September 16, 2011 limit 0,5 - first five limit 5,5 - skip first five, select next five limit 10,5 - skip ten you need to write code like this: $page = isset($_GET['page']) ? (int) $_GET['page'] : 0; $query = 'Select * from tabName Limit ' . ($page *5) . ', 5'; Quote Link to comment https://forums.phpfreaks.com/topic/247273-how-to-apply-limit-on-result-of-records/#findComment-1269908 Share on other sites More sharing options...
man12_patil3 Posted September 16, 2011 Author Share Posted September 16, 2011 I think this is not my solution. i already implicated pagination in my script. i want to fetch 25 Product from table then apply on that pagination ....... Quote Link to comment https://forums.phpfreaks.com/topic/247273-how-to-apply-limit-on-result-of-records/#findComment-1269909 Share on other sites More sharing options...
AyKay47 Posted September 16, 2011 Share Posted September 16, 2011 if you already did it then why are you asking how to do it? Quote Link to comment https://forums.phpfreaks.com/topic/247273-how-to-apply-limit-on-result-of-records/#findComment-1269914 Share on other sites More sharing options...
man12_patil3 Posted September 16, 2011 Author Share Posted September 16, 2011 i want to fetch 25 Product from table then apply on that pagination ....... and i don't now the how many record in table.... Quote Link to comment https://forums.phpfreaks.com/topic/247273-how-to-apply-limit-on-result-of-records/#findComment-1269920 Share on other sites More sharing options...
AyKay47 Posted September 16, 2011 Share Posted September 16, 2011 read the tutorial in the link i gave you Quote Link to comment https://forums.phpfreaks.com/topic/247273-how-to-apply-limit-on-result-of-records/#findComment-1269923 Share on other sites More sharing options...
web_craftsman Posted September 16, 2011 Share Posted September 16, 2011 Do inner 25 records by 5 per page using javascript Quote Link to comment https://forums.phpfreaks.com/topic/247273-how-to-apply-limit-on-result-of-records/#findComment-1269927 Share on other sites More sharing options...
fenway Posted September 16, 2011 Share Posted September 16, 2011 Or just a subquery. Quote Link to comment https://forums.phpfreaks.com/topic/247273-how-to-apply-limit-on-result-of-records/#findComment-1270111 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.