RE: [SMARTY] Paging db results

From: Date: Thu, 06 May 2004 14:50:19 +0000
Subject: RE: [SMARTY] Paging db results
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11367@lists.php.net to get a copy of this message
George, The *right* way to do this (it's called pagination), is to limit your result set in the php code. Send to the template the data that you want to display on the screen. Then in the php code create your pagination links. There's a couple models for how the links are displayed. You could do [prev] [next] buttons, or < 1 2 3 > like google, or < 1 2 3 4...10 11 >. In all cases you determine what the pagination links are and send them as a string or array to smarty to display. Chris -----Original Message----- From: George Pitcher [mailto:george.pitcher@ingenta.com] Sent: Thursday, May 06, 2004 12:16 AM To: smarty-general@lists.php.net Subject: [SMARTY] Paging db results Hi, I'm new to Smarty, having played around with it for a week now. I'm building a web version of a Filemaker database gui and I need to be able to produce paged results. These aren't the usual 10 or 25 rows per page, but 1 record per page, displaying around 60 fields. The recordset could be as many as 6-700. Just to complicate matters, in addition to moving through the recordset I als want to be able to move between different functional pages, whilst remaining in the curent position of the original recordset. Ideally, this would not entail performing a SQL query each time I change layouts. I'm using PEAR DB to access MySQL and my development is based on Win2K/IIS5 but final deployment will be Linux/Apache. Any tips, suggestions or advice would be welcome. George in Oxford -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.smarty.general (#11367) next »