| | |
Pagination Without Limit in Query
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 121
Reputation:
Solved Threads: 2
is there any way to paginate the page without using limit in Query..!!
Actually i m working on predefined stored procedures. and i m not allowed to make in changes that..!!! and that does contain limit function at all..!!!!
any suggestions how should i do it.?
thanks in advance
Actually i m working on predefined stored procedures. and i m not allowed to make in changes that..!!! and that does contain limit function at all..!!!!
any suggestions how should i do it.?
thanks in advance
Last edited by sam023; Nov 3rd, 2009 at 5:40 am.
0
#2 Nov 3rd, 2009
Surely pagination without a limit would not be pagination...
The limit is there to specify how many results are retreived, without it all records would be pulled on each query.
The limit is there to specify how many results are retreived, without it all records would be pulled on each query.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
0
#3 Nov 3rd, 2009
look around for using SQL_CALC_FOUND_ROWS in query, it may help you
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
0
#5 Nov 3rd, 2009
so whats the need to do this, anyways you fetching the entire data and storing it to some array, it will consume lots and lots of memory.Better to use the MySQL query with the limit.
You can cache the result coming each time for some predefined time duration.It will help to make the results faster.
You can cache the result coming each time for some predefined time duration.It will help to make the results faster.
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
0
#7 Nov 3rd, 2009
why you cant use the limit in query, just post your code and the problem it creates when used the limit.
I am sure there is some misconception about some patch of code
I am sure there is some misconception about some patch of code
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Jun 2009
Posts: 121
Reputation:
Solved Threads: 2
0
#8 Nov 4th, 2009
mysql Syntax (Toggle Plain Text)
DELIMITER $$ DROP PROCEDURE IF EXISTS `dd`.`view_ratecard`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `view_ratecard`(id_tariffplan INT(11),country_code CHAR(30)) BEGIN if(country_code="") THEN SELECT dialprefix,destination,rateinitial,initblock,billingblock,id_trunk,grace,idtariffplan,id FROM cc_ratecard WHERE idtariffplan=id_tariffplan AND rate_version='0' ORDER BY destination asc; ELSE SELECT dialprefix,destination,rateinitial,initblock,billingblock,id_trunk,grace,idtariffplan,id FROM cc_ratecard WHERE idtariffplan=id_tariffplan AND rate_version='0' AND dialprefix LIKE CONCAT(country_code,'%') ORDER BY destination asc; END if ; END$$ DELIMITER ;
Last edited by sam023; Nov 4th, 2009 at 1:10 am.
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
0
#9 Nov 4th, 2009
It is always nice to have one SP against such queries which get fired often.Ok, they told you to implement the same SP as it is and you are worried about the pagination.You can proceed the way you want like gettign everything in entire array, if you are sure that, the rows returned by that SP are not much.
Or else you can modify the same simple SP to accept the start index and the page_size for making pagination easier.
Or else you can modify the same simple SP to accept the start index and the page_size for making pagination easier.
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
![]() |
Similar Threads
- How to use large pagination in a limited area (PHP)
- Clean Previous Next Script for MySQL results (PHP)
- pagination not displaying results (PHP)
- About LIMIT in mysql (PHP)
- search results question (PHP)
- pagination problem (PHP)
- pagination of mysql query results (PHP)
- PHP Search pagination problem (PHP)
Other Threads in the PHP Forum
- Previous Thread: send html form as mail attachment in php
- Next Thread: stop playing 4 10 sec while buffer mp3 file?
Views: 961 | Replies: 27
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube





