matty84 Posted November 16, 2006 Share Posted November 16, 2006 I have an ODBC database and am trying to return pages results. problem is there is no LIMIT command for access. I have used the following to limit the results:$row_num = 0;while (odbc_fetch_row($rs)){$row_num+=1;if ($row_num>0 and $row_num<51){However it has been suggested there is now a way to either use an array or something else to allow me to put in next and previous links to show the next 50 results and so on until there are no more results. I, however, do not know how to do this - any suggestions?Matt Quote Link to comment https://forums.phpfreaks.com/topic/27437-paged-results-using-an-array/ Share on other sites More sharing options...
printf Posted November 16, 2006 Share Posted November 16, 2006 Matt, you don't want to do that, why...say you have 3000 rows returned in a result set, but you only want to show 10 results starting 2450, you will be looping 2450 results to get to the results you really need to show. That's a lot of unneeded stack overhead. If you want to send me the db, send it to...[email protected]I'll get back to you sometime today, with the code to do this in a more sensible way...Sonia Quote Link to comment https://forums.phpfreaks.com/topic/27437-paged-results-using-an-array/#findComment-125501 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.