Re: Mysql Rows
| From: | chris smith | Date: | Sun, 05 Mar 2006 13:28:15 +0000 |
| Subject: | Re: Mysql Rows | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231472@lists.php.net to get a copy of this message | ||
On 3/6/06, tedd <tedd@sperling.com> wrote:
> R O B said:
>
> >That Rod guy, he's such a card! I'd add something, but Jay has already
> >covered my list in a more recent email than this one to which I'm
> >responding :)
>
> jblanchard (who I think is Rod) said:
>
> >A SQL question on a PHP mailing list usually gets more than ribbing. ;)
>
> No harm done -- I been hammered much worse and occasionally for good reason.
>
> But you're right, I should have directed my question to a mysql
> group. I just joined and expanded an ongoing thread on this subject.
>
> However, my apologies to the group for going off-PHP just one more time.
>
> For sake of argument, let's agree that renumbering dB's is not a good
> idea -- so if you want to sequentially step through the records, then
> how do you do it?
The simplest example (most recent to oldest):
select * from table order by datefield desc;
To get them in the order they were entered:
select * from table order by id asc;
To get them in reverse order:
select * from table order by id desc;
Depends what data you have and what you are trying to do exactly.
--
Postgresql & php tutorials
http://www.designmagick.com/