snrecords Posted November 20, 2007 Share Posted November 20, 2007 Hi all! Again I'm new to php and mysql ... I have a site that retrieves data from the mysql database where query results shows everything on one page. Since there are nearly 40+ rows of results ... it takes forever to load the entire page. Now in comparison, I have a different query on my site that was pre-built with the software package I bought. This query shows over 300 results (almost instantaneously) because the results are divided onto multiple pages (just like how search engines do it - except this query shows 20 rows instead of 10). My question is ... why does a query with results on multiple pages show up so much faster than the page with all the results on one page? Does this process work similarly to how music or video is streamed? And lastly, if I change all the queries on my site to show up on multiple pages ... will they all process results equally fast or are there other factors involved? I know this is a lot of questions ... but any help is appreciated. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted November 20, 2007 Share Posted November 20, 2007 your referring to pagination and it depends on the content of your fields and what each type of field is; on how fast each page will load the contents from database. this is not like streaming video/music; this is a php script that you set up to only allow specific rows from your database to be displayed on each individually paginized page. pagination usually occurs when the php script is queried with a string sent in by a $_GET, $_POST, $_SESSION, or $_COOKIE variable. this is most commonly done with the $_GET global variable. do a search on this forum/site or google for "PHP Pagination" and you will be able to see an example of how this works. 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.