Re: [PHP] Re: May i?
You can reset the id with this command: ALTER TABLE $tablename AUTO_INCREMENT = 242 : : Flavio Bastos Amiel: : : : : : INVALID_ADDRESS_IN_GROUP@.SYNTAX-ERROR., Flavio Bastos Amiel:: wrote:let's see if i can do it... i got a news site. everything was going OKsometimes i made few testing and then i delete the content from the db... the problem is next: the item id is an auto_increment element .. so the id's wasn't going allrightbecause they where not true... sometimes they make jumps like id #25 and the id #30 (because of the testing i've done and then delete) i tried to delete that cell (id) and then i recreate it. thinking the id was going to count it all over and make the item id TRUE.but it wasn't like that, the new id was counting since the last id then if the last id was 100, the new id was counting from 100 to 200 do i explain myself?... does anyone have an answer to this problem (PLEASE Dont tell me i have to do i manually!! ) thanks, Flavio Bastos Amiel George Nicolae wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ask. -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com ::: Flavio Bastos Amiel:: wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... May i ask for help about a subejct on MySQL here? thanks, Flavio Bastos Amiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ~ Manuel Ochoa ~ Seven days is too long to wait for a gun! - Do You Yahoo!? Yahoo! Health - Feel better, live better
RE: [PHP] Re: May i?
Why do you need it anyway? auto_increment is a mySQL functionality to (listen this carefully) KEEP UNICITY WITHIN A TABLE. This is what they are needed for. I agree - it would look prettier having them even sequential, but that is behind the real point and it is not a problem. You should make your application independent from id value - id should only serve you as a key to relate the data within application/database. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: ::: Flavio Bastos Amiel:: [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 2:28 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: May i? let's see if i can do it... i got a news site. everything was going OKsometimes i made few testing and then i delete the content from the db... the problem is next: the item id is an auto_increment element .. so the id's wasn't going allrightbecause they where not true... sometimes they make jumps like id #25 and the id #30 (because of the testing i've done and then delete) i tried to delete that cell (id) and then i recreate it. thinking the id was going to count it all over and make the item id TRUE.but it wasn't like that, the new id was counting since the last id then if the last id was 100, the new id was counting from 100 to 200 do i explain myself?... does anyone have an answer to this problem (PLEASE Dont tell me i have to do i manually!! ) thanks, Flavio Bastos Amiel George Nicolae [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ask. -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com ::: Flavio Bastos Amiel:: [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... May i ask for help about a subejct on MySQL here? thanks, Flavio Bastos Amiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: May i?
On Tue, Sep 03, 2002 at 08:27:37PM -0400, ::: Flavio Bastos Amiel:: wrote: i tried to delete that cell (id) and then i recreate it. thinking the id was going to count it all over and make the item id TRUE.but it wasn't like that, the new id was counting since the last id then if the last id was 100, the new id was counting from 100 to 200 do i explain myself?... does anyone have an answer to this problem (PLEASE Dont tell me i have to do i manually!! ) You can use a version of mysql prior to 3.23, which is the version that this behavior was introduced. Many people, myself included, believe the ability to use numbers that were used previously is a bug, so in 3.23, once a number is used in an auto incrementing column it cannot be used again. At least mysql won't auto generate it again. -- Jason Stechschulte [EMAIL PROTECTED] http://www.ypisco.com -- To teach is to learn. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: May i?
well... yes, then maybe i made a mistake there was data related to the id . then i delete that row and the data that was related to the comments are gone away, because the row id has changedso i would have to put then manually again Flavio Bastos Amiel Maxim Maletsky [EMAIL PROTECTED] wrote in message 000c01c23b50$050fcfe0$1113fe17@dominanta">news:000c01c23b50$050fcfe0$1113fe17@dominanta... Why do you need it anyway? auto_increment is a mySQL functionality to (listen this carefully) KEEP UNICITY WITHIN A TABLE. This is what they are needed for. I agree - it would look prettier having them even sequential, but that is behind the real point and it is not a problem. You should make your application independent from id value - id should only serve you as a key to relate the data within application/database. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: ::: Flavio Bastos Amiel:: [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 2:28 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: May i? let's see if i can do it... i got a news site. everything was going OKsometimes i made few testing and then i delete the content from the db... the problem is next: the item id is an auto_increment element .. so the id's wasn't going allrightbecause they where not true... sometimes they make jumps like id #25 and the id #30 (because of the testing i've done and then delete) i tried to delete that cell (id) and then i recreate it. thinking the id was going to count it all over and make the item id TRUE.but it wasn't like that, the new id was counting since the last id then if the last id was 100, the new id was counting from 100 to 200 do i explain myself?... does anyone have an answer to this problem (PLEASE Dont tell me i have to do i manually!! ) thanks, Flavio Bastos Amiel George Nicolae [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ask. -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com ::: Flavio Bastos Amiel:: [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... May i ask for help about a subejct on MySQL here? thanks, Flavio Bastos Amiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: May i?
Hi. I used to wonder that myself too. Now (after lots of auto_increment fields I've done) I know that a sequential order is just pretty but useless 'cause MySQL won't give you a maximum fields allowed. The solution is pretty easy. Just make an SQL query like this: SQL ALTER TABLE table_name AUTO_INCREMENT = 1; And that's it... it will restore the counting back to where it was left. HTH, C. -Original Message- From: ::: Flavio Bastos Amiel:: [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 10:09 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: May i? well... yes, then maybe i made a mistake there was data related to the id . then i delete that row and the data that was related to the comments are gone away, because the row id has changedso i would have to put then manually again Flavio Bastos Amiel Maxim Maletsky [EMAIL PROTECTED] wrote in message 000c01c23b50$050fcfe0$1113fe17@dominanta">news:000c01c23b50$050fcfe0$1113fe17@dominanta... Why do you need it anyway? auto_increment is a mySQL functionality to (listen this carefully) KEEP UNICITY WITHIN A TABLE. This is what they are needed for. I agree - it would look prettier having them even sequential, but that is behind the real point and it is not a problem. You should make your application independent from id value - id should only serve you as a key to relate the data within application/database. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: ::: Flavio Bastos Amiel:: [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 2:28 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: May i? let's see if i can do it... i got a news site. everything was going OKsometimes i made few testing and then i delete the content from the db... the problem is next: the item id is an auto_increment element .. so the id's wasn't going allrightbecause they where not true... sometimes they make jumps like id #25 and the id #30 (because of the testing i've done and then delete) i tried to delete that cell (id) and then i recreate it. thinking the id was going to count it all over and make the item id TRUE.but it wasn't like that, the new id was counting since the last id then if the last id was 100, the new id was counting from 100 to 200 do i explain myself?... does anyone have an answer to this problem (PLEASE Dont tell me i have to do i manually!! ) thanks, Flavio Bastos Amiel George Nicolae [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ask. -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com ::: Flavio Bastos Amiel:: [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... May i ask for help about a subejct on MySQL here? thanks, Flavio Bastos Amiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php