niche Posted June 23, 2012 Share Posted June 23, 2012 (edited) I've never written code that displays db results in mult pages. I found the LIMIT clause at: http://dev.mysql.com.../en/select.html and thatseems to be the critical code to solve my problem. I'd like to know if there's an easierapproach that wouldn't involve LIMIT to display db result in mult pages? EDIT: My thinking would turn the offset of the first row to return and and the maximum numberof rows to return into variables of course . Edited June 25, 2012 by niche Link to comment Share on other sites More sharing options...
Don E Posted June 23, 2012 Share Posted June 23, 2012 Are you referring to pagination? 1 Link to comment Share on other sites More sharing options...
niche Posted June 23, 2012 Author Share Posted June 23, 2012 Yes. Shows how much I don't know about it. Link to comment Share on other sites More sharing options...
birbal Posted June 23, 2012 Share Posted June 23, 2012 you need to do like this SELECT CALC_FOUND_ROWS *.......LIMIT 0,10 immidiately after executing this you have to execute FOUND_ROWS() which will give the total found rows which you can use to determine the number of pages. 1 Link to comment Share on other sites More sharing options...
niche Posted June 25, 2012 Author Share Posted June 25, 2012 Thanks for your help Don E and birbal. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now