Re: Get the

From: Date: Wed, 26 Jul 2000 12:50:58 +0000
Subject: Re: Get the
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8288@lists.php.net to get a copy of this message
> Suppose I have a table full of data and > only want to return the _last_ ten rows > of that table. Is there a fast way using > a SELECT command? > > Right now, I'm loading all the rows, > reversing the order and outputting > the first ten... :/ in the SQL use the DESC and ASC to reverse order, and LIMIT x,y to limit the search to a certain range. That way you only have to output the rows you actually receive. that should be a lot faster than doing it in php. Cheers, Soeren Staun-Pedersen - staun@netwarriors.org ------ "The internet is full, beat it" - Me.

« previous php.general (#8288) next »