Re: Too many records to display in one web page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 6:17 PM -0500 5/26/07, Eduardo Vizcarra wrote:
Hi All

I am developing a web site that interacts with a MySQL database. When I run
a query and display the records in a web page, this can become a problem
because there might be too many records to be displayed in one single web
page so I am trying to divide the total number of records and display them
in multiple pages. Let's say, if the query returns 100 records then I would
like to display the first 10 records and then put a navigation bar where I
can go to the next 10 or return to the previous 10 records

Is this done at a SQL or PHP level ? any experience on doing this ?

Thanks a bunch
Eduardo

Eduardo:

Yes, look into "LIMIT" in MySQL.

Such as:

$dbQuery="SELECT $id FROM $dbtable ORDER BY title LIMIT $offset, $rowsPerPage";

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux