Re: Mysql Rows
| From: | Murray @ PlanetThoughtful | Date: | Sat, 04 Mar 2006 07:49:37 +0000 |
| Subject: | Re: Mysql Rows | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231445@lists.php.net to get a copy of this message | ||
On 4/03/2006 5:36 PM, Anthony Ettinger wrote:
Yep, that's one good reason among many for using unique ids.
Thinking a
little about the OP's question, I could understand row order being
relevant in certain situations where you wanted to display something
like, "You were the 432nd person to register at our site!", etc.
I'd do this with a timestamp, and then sorting by date and doing a count() on the results. But then again that's just me. I remember the days where i'd clear a database after testing to keep the auto_increment inline, but eventually, you will get out of sync on that, so it's not a reliable way of keeping a numerical sequence.
Right, or you could just as easily do the same sort and WHERE clause by your unique id, but even just doing a count, you're interested in the fact that the record is at position <whatever> in that recordset, so 'row order' is relevant and, in that context, meaningful.
Much warmth,
planetthoughtful
---
"Lost in thought"
http://www.planetthoughtful.org