On 4/03/2006 2:49 PM, benifactor wrote:
thank you. the table does have and id feild that auto increments, however if
you delete a user there will be a gap between the users between which would
not be what is not acurate enough. thank you for you help. simple fix. i
should have caught it.
----- Original Message -----
From: "Anthony Ettinger" <aettinger@xxxxxxxxxxxxxx>
To: "benifactor" <snorris17@xxxxxxx>
Cc: "php" <php-general@xxxxxxxxxxxxx>
Sent: Friday, March 03, 2006 3:52 PM
Subject: Re: Mysql Rows
define $1 = 0 outside your loop.
i'm curious why you are relying on row-order in the database?
Typically you'd have a PRIMARY KEY auto_increment for something like
this.
I have to agree with Anthony - why are you using row order to determine
something relating to users? I couldn't follow your brief explanation
above, and the fact that you're doing it sets off some soft alarm bells
about the design of your application. Why is it important that there
shouldn't be any 'gaps' between users? Because you want to know how many
users there are? If so, simply do a SELECT COUNT(*) on the table
whenever / wherever you need to know.
If you're using it for IDs for the users, it's generally a bad idea to
reuse this type of information. If you have some other purpose, I'm
extremely curious about what it might be.
Much warmth,
planetthoughtful
---
"Lost in thought"
http://www.planetthoughtful.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php