php-windows | 2003112
Date: 11/27/03
- Next message: Ignatius Reilly: "Re: [PHP-WIN] Code to splite page"
- Previous message: Donatas: "Re: [PHP-WIN] Redirection"
- Maybe in reply to: Lawrence: "[PHP-WIN] Code to splite page"
- Next in thread: Ignatius Reilly: "Re: [PHP-WIN] Code to splite page"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 <email protected>]
Sent: Thursday, November 27, 2003 8:43 AM
To: php-windows <email protected>
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-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Ignatius Reilly: "Re: [PHP-WIN] Code to splite page"
- Previous message: Donatas: "Re: [PHP-WIN] Redirection"
- Maybe in reply to: Lawrence: "[PHP-WIN] Code to splite page"
- Next in thread: Ignatius Reilly: "Re: [PHP-WIN] Code to splite page"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

