Re: Re: Newbie Questions
| From: | Pete Holsberg | Date: | Sat, 04 Sep 2004 20:08:05 +0000 |
| Subject: | Re: Re: Newbie Questions | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36046@lists.php.net to get a copy of this message | ||
On Sat, 4 Sep 2004, Torsten Roehr wrote:
> > > "SELECT firstname, lastname, address FROM TABLENAME
> > > ORDER BY lastname ASC";
> > >
> > > Use ASC or DESC to order your query results. When you
> > > iterate over the result as Torsten indicated,
> > > everything will be in the order you specify.
> >
> > In the database table itself, right? Does it make more
> > sense to do that than to leave the database alone, read
> > it into an array and then sort it anyway I want (there
> > will be at least two different sorted lists I want it
> > to produce)?
>
> Sorting in the database should always be the preferred
> way - should be quicker than doing it in the application
> in 9 out of 10 times.
Thank you.