Orionsbelter Posted November 5, 2009 Share Posted November 5, 2009 Hi there, i am currently wanting to make a shop for myself and need to know how i can make the code, so that my page shows 20 products per page, or a choosen amount such as 20, 40, 60 etc, then have pages 1,2,3 etc depending on the amount of products. so for example i am viewing 20 products, so the page shows the first 20 products i click page 2 i shows the next 20, how can i do this thank you Quote Link to comment Share on other sites More sharing options...
clay1 Posted November 6, 2009 Share Posted November 6, 2009 $numofproductsperpage = 20; $i = 1; while ( $i < $numproductsperpage) { show product $i++; } Quote Link to comment Share on other sites More sharing options...
JJ2K Posted November 6, 2009 Share Posted November 6, 2009 $numofproductsperpage = 20; $i = 1; while ( $i < $numproductsperpage) { show product $i++; } Just out of curiousity is there any reason why you use a while loop instead of a for loop? Quote Link to comment Share on other sites More sharing options...
clay1 Posted November 6, 2009 Share Posted November 6, 2009 As far as I know there is no real difference between for or while except for claims of speed Quote Link to comment 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.