RE: [PHP-WIN] Code to splite page
| From: | Croskerry, Dan | Date: | Thu, 27 Nov 2003 14:09:02 +0000 |
| Subject: | RE: [PHP-WIN] Code to splite page | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-22225@lists.php.net to get a copy of this message | ||
Hi Lawrence,
I'm assuming you are pulling these products from a mysql db. If so you can
use the LIMIT clause.
$sql = "SELECT * FROM table LIMIT 1, 10"; //where these integers represent
row_count, OFFSET
Read more here http://www.mysql.com/doc/en/SELECT.html
You can substitute a variable for the row_count so that you can page back
and forth via get vars.
$sql = "SELECT * FROM table LIMIT ".$startat.", 10";
If you are pulling from MSSQL then there is no limit functionality and you
have to code the offset yourself. This is a pain and I don't have that chunk
of code on hand right now. Maybe someone else does...
Dan
-----Original Message-----
From: Lawrence [mailto:goodboy@fptnet.com]
Sent: Thursday, November 27, 2003 8:43 AM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Code to splite page
I need the code to splite page , I have 50 products , I want splite 10
products per page , if anyone has that , please show me , thank you
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php