Re: displaying information

From: Date: Fri, 09 Mar 2001 14:38:36 +0000
Subject: Re: displaying information
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43149@lists.php.net to get a copy of this message
Hello, if you use mysql as a database, see the function Limit For exemple: if ( !isset( $start ){ $start = 0; } $total = 10; // total amount to grab in database $sql = "SELECT * FROM my_table ORDER BY field Limit $start, $total"; $start += 10; // increment your start You display those fields, and you show a next link: <a href="<? print "$PHP_SELF?start=$start"; ?>Next</a> But if you do not use mysql, I do not know... py Nick Davies wrote: > On Fri, 9 Mar 2001, Jason Stechschulte wrote: > > > On Thu, Mar 08, 2001 at 09:32:25PM -0000, george wrote: > > > I am building a site which pulls FAQ's out of the database onto a page,but > > > having just finished reading the FAQ's I realise that they will have to be > > > spread over a few pages, > > > how to I get the new page to take over where the old page finished. > > > > I would try programming, that usually works for me. > > > > You will have to let the program know where you left off, you could pass > > it in the url, set a cookie, or put it to the session. Either way, just > > do a little programming and voila. > > Or you could just pass the offset in the url and use SQL to limit the > search. > > I can't remeber the exact stuff but all you need to do is write the select > with an offset (where to start the select) and a limit (10 results > perhaps). You will then only get that data set. > > Just add limit to the offset and pass that onto the next instance of the > page to use as the next offset. > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#43149) next »