php - using LIMIT 0, 20 for infinite scroll - how to limit the number of total results? -


i have query:

 select * table id not null order desc limit :start, :limit 

the start , limit there ajax infinite scroll / pagination work

how can limit total results if im using limit pagination?

i need query similar below:

select * table id not null order desc limit :start, :limit limit 5000 

you can calculate without query. if don't want more 5000 results, should work:

if (($start + $limit) <= 5000) {     // query } else {     // don't query, maximum limit reached } 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -