Re: DESC order results
| From: | Richard Lynch | Date: | Mon, 14 Jan 2008 17:16:41 +0000 |
| Subject: | Re: DESC order results | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267221@lists.php.net to get a copy of this message | ||
On Sun, January 13, 2008 12:54 pm, Danny Brow wrote:
> Just wondering if anyone could tell me how reliable the DESC order
> option is going to be when I am parsing thousands of records where
> they
> are multiple ChartNo's for the same clientNo. Or is there a better way
> to grab the most recent ChartNo.
This is not actually a PHP question...
Assuming ChartNo is some kind of autoincrement field, it HAPPENS to be
100% reliable in current MySQL implementation.
Unfortunately, it's also 100% the *WRONG* way to go about this, as the
MySQL dev team could change their implementation of autoincrement at
any time, for any reason, and you'd be up the creek without a paddle
[*].
If you want the most RECENT chart in time, you should time-stamp every
chart with a datetime field, and use that in DESC in your query.
You should take this discussion to the MySQL list if you wish to
understand why.
[*] It has just occured to me that being UP the creek with no paddle
isn't much of a big deal, as you can just drift back down. Being DOWN
the creek with no paddle, however, would be more problematic. English
is such a curious language...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?