At 9:04 PM -0400 9/4/07, brian wrote:
You're being pissy again. It really reflects poorly on you and, i
suspect, it's keeping you from truly understanding what it is that
i'm trying to help you with.
Enough said on this subject, besides I don't think you're reading
what I write correctly
At 6:18 PM -0400 9/3/07, brian wrote:
Renumbering anything is pretty quick these days. To me, things that
are horribly inefficient are also slow. So, I don't agree. If I
remember correctly, I can even renumber a 100K item dB
auto_increment index in less than one second -- but I wouldn't
Surely we're into basic database design. If you have an auto_increment
record key that needs changing from time to time then you've designed
the database incorrectly. Use a 'normal' key field such as
Product_Id and have your application generate the number.
Simple.
No?
On 9/4/07, tedd [EMAIL
tedd wrote:
At 6:18 PM -0400 9/3/07, brian wrote:
It may be just fine in your case, but from a DB design standpoint it
most certainly is not efficient. Why re-order the entire table for
something like this? Altering an entire table because one row has been
deleted suggests to me that the
At 12:11 PM -0400 9/4/07, brian wrote:
tedd wrote:
At 6:18 PM -0400 9/3/07, brian wrote:
It may be just fine in your case, but from a DB design standpoint
it most certainly is not efficient. Why re-order the entire table
for something like this? Altering an entire table because one row
has
tedd wrote:
At 12:11 PM -0400 9/4/07, brian wrote:
You are confusing a product ID with this index number. They are
very much not the same thing. A product ID (PLU, serial #,
whatever) should not change. This index does change, any time a row
is removed from the database. How can you suggest
At 10:27 AM +1000 9/3/07, Chris wrote:
tedd wrote:
At 6:14 PM -0400 9/2/07, brian wrote:
tedd wrote:
Hi to the original poster:
Snip -- a lot of discussion
Use the following code at your own peril.
$dbQuery = ALTER TABLE $dbtable ;
$dbQuery .= DROP id, ;
$dbQuery .= ADD id INT UNSIGNED NOT
tedd wrote:
At 10:27 AM +1000 9/3/07, Chris wrote:
tedd wrote:
At 6:14 PM -0400 9/2/07, brian wrote:
tedd wrote:
How is that contrary to what I said?
You are actually changing the id's in the database.
Brian's example is making up an id to display (much like the excel row
numbers)
At 11:48 AM -0400 9/3/07, brian wrote:
tedd wrote:
At 10:27 AM +1000 9/3/07, Chris wrote:
tedd wrote:
At 6:14 PM -0400 9/2/07, brian wrote:
tedd wrote:
How is that contrary to what I said?
You are actually changing the id's in the database.
Brian's example is making up an id to
tedd wrote:
At 11:48 AM -0400 9/3/07, brian wrote:
Arrggg. No, I did not say create another auto_increment field -- I said:
Quote
The reason for not wanting to care about the auto_increment id is that
it is something that the database uses and really should not be changed.
If you want to
At 3:17 PM -0400 9/3/07, brian wrote:
tedd wrote:
As for the gap problem, there is no gap problem if you create
another field for record number and alter it to your liking (NOTE:
I did not say AUTO_INCREMENT). If you add/delete a record, then
adjust the field for record number accordingly.
tedd wrote:
At 3:17 PM -0400 9/3/07, brian wrote:
Well, yes, that would work also but is horribly inefficient because
the *entire table* must be altered any time a row is deleted.
horribly inefficient?
Renumbering anything is pretty quick these days. To me, things that are
horribly
If I've understood correctly your record/Id number relates to a message/post.
Let's say the PHP list has message numbers and this post is number
456. If I have a list of posts and sort them by user and provide the
user with a numbered list of posts from 1 to N in user sequence
there's VERY little
Hi to the original poster:
Snip -- a lot of discussion
Use the following code at your own peril.
$dbQuery = ALTER TABLE $dbtable ;
$dbQuery .= DROP id, ;
$dbQuery .= ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,;
$dbQuery .= AUTO_INCREMENT = 1;
$result = mysql_query($dbQuery) or die(Could not
tedd wrote:
Hi to the original poster:
Snip -- a lot of discussion
Use the following code at your own peril.
$dbQuery = ALTER TABLE $dbtable ;
$dbQuery .= DROP id, ;
$dbQuery .= ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,;
$dbQuery .= AUTO_INCREMENT = 1;
$result = mysql_query($dbQuery) or
At 6:14 PM -0400 9/2/07, brian wrote:
tedd wrote:
Hi to the original poster:
Snip -- a lot of discussion
Use the following code at your own peril.
$dbQuery = ALTER TABLE $dbtable ;
$dbQuery .= DROP id, ;
$dbQuery .= ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,;
$dbQuery .= AUTO_INCREMENT =
tedd wrote:
At 6:14 PM -0400 9/2/07, brian wrote:
tedd wrote:
Hi to the original poster:
Snip -- a lot of discussion
Use the following code at your own peril.
$dbQuery = ALTER TABLE $dbtable ;
$dbQuery .= DROP id, ;
$dbQuery .= ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,;
$dbQuery .=
I don't think you really want to do that, either. You don't need a
field in the database to accomplish what you are trying to do.
Execute your query to select the records you want, sorting them into
what ever order you want. When you display the records on your web
page, add a PHP variable,
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for awhile
since my project will be done, at least until the users say What
happened to XYZ then I'll ask again :)
I asked on a MySQL list about Resetting a auto increment filed
Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
What happened to XYZ then I'll ask again :)
I asked on a MySQL list about Resetting a auto
On Aug 30, 2007, at 5:14 AM, Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
What happened to XYZ then I'll ask again :)
I asked on a MySQL
M. Sokolewicz wrote:
Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
What happened to XYZ then I'll ask again :)
I asked on a MySQL list
Jason Pruim wrote:
On Aug 30, 2007, at 5:14 AM, Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
What happened to XYZ then I'll ask again :)
I
On Aug 30, 2007, at 6:34 AM, Stut wrote:
Jason Pruim wrote:
On Aug 30, 2007, at 5:14 AM, Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking
for awhile since my project will be done, at least until the
users say What
Jason Pruim wrote:
The information is being displayed in a table, and can be sorted by any
of the fields. The purpose of the application I am writing is going to
be a online database, giving my customers access to their mailing list
24/7 from anywhere in the world.
Alot of the customers that
On Aug 30, 2007, at 6:52 AM, Stut wrote:
Jason Pruim wrote:
The information is being displayed in a table, and can be sorted
by any of the fields. The purpose of the application I am writing
is going to be a online database, giving my customers access to
their mailing list 24/7 from
Hi Everyone,
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
What happened to XYZ then I'll ask again :)
I asked on a MySQL list about Resetting a auto increment filed so
that there arn't any gaps in
[snip]
Is there away with PHP that I can pragmatically change that value to
the total records in the database more so then a representation of
the actual record number?
[/snip]
1. Changing the values in an auto-increment column is just Bad[tm],
especially if you are using it as a unique
On Aug 29, 2007, at 1:58 PM, Jay Blanchard wrote:
[snip]
Is there away with PHP that I can pragmatically change that value to
the total records in the database more so then a representation of
the actual record number?
[/snip]
1. Changing the values in an auto-increment column is just
Jason Pruim wrote:
3. Ask yourself, Is it important to keep the auto-increment field
contiguous?
The main reason for changing it is I do currently have an option to sort
by record number, although, if I add a Record number in php, but still
have it sort based off of the record number stored
--- Jason Pruim [EMAIL PROTECTED] wrote:
So to say it another way, I have a table that has
900 records in it,
I've added 3 records, but then deleted 2 of those
which puts the
actual record count at 901 but my auto increment
field starts at 904
on the next insert.
Is there away
Jason Pruim wrote:
Hi Everyone,
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
What happened to XYZ then I'll ask again :)
I asked on a MySQL list about Resetting a auto increment filed so
that
On 8/29/07, Stephen [EMAIL PROTECTED] wrote:
--- Jason Pruim [EMAIL PROTECTED] wrote:
So to say it another way, I have a table that has
900 records in it,
I've added 3 records, but then deleted 2 of those
which puts the
actual record count at 901 but my auto increment
field starts at
On Wed, August 29, 2007 12:49 pm, Jason Pruim wrote:
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
What happened to XYZ then I'll ask again :)
I asked on a MySQL list about Resetting a auto increment
On Aug 29, 2007, at 3:02 PM, Richard Lynch wrote:
On Wed, August 29, 2007 12:49 pm, Jason Pruim wrote:
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
What happened to XYZ then I'll ask again :)
I asked
On Aug 29, 2007, at 2:41 PM, Stephen wrote:
--- Jason Pruim [EMAIL PROTECTED] wrote:
So to say it another way, I have a table that has
900 records in it,
I've added 3 records, but then deleted 2 of those
which puts the
actual record count at 901 but my auto increment
field starts at 904
on
On Aug 29, 2007, at 2:27 PM, Jim Lucas wrote:
Jason Pruim wrote:
3. Ask yourself, Is it important to keep the auto-increment field
contiguous?
The main reason for changing it is I do currently have an option
to sort by record number, although, if I add a Record number in
php, but still
-general@lists.php.net From: [EMAIL PROTECTED] Date: Wed, 29
Aug 2007 13:49:02 -0400 Subject: [PHP] Pragmatically changing a Record
Number Hi Everyone, I think after I get this question answered, I can
stop asking for awhile since my project will be done, at least until the
users say What
38 matches
Mail list logo