Re: Mysql Rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/6/06, tedd <tedd@xxxxxxxxxxxx> 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/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux