auto_increment command

auto_increment command

am 12.03.2007 01:52:52 von Ron Piggott

--=-BI+BZPkYzAkrBR0+o239
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I am not sure if that last e-mail went through or not. I am wondering
how to re-set the auto_increment field back to 1 in one of my tables.
Ron

--=-BI+BZPkYzAkrBR0+o239--

Re: auto_increment command

am 12.03.2007 02:55:50 von bedul

u can't
----- Original Message -----
From: "Ron Piggott"
To: "PHP DB"
Sent: Monday, March 12, 2007 7:52 AM
Subject: [PHP-DB] auto_increment command


> I am not sure if that last e-mail went through or not. I am wondering
> how to re-set the auto_increment field back to 1 in one of my tables.
> Ron

there no such thing reset auto_increment
if you need the reset.. there were way to do that.
rename the table.. then take query to build it
create new table and tralalla.. u have reset it.

fyi. if inside the table already have a data were id was 100.. the next id
must be 101..
btw.. if you want to make your table more clean (i said about.. how random
the num).. there is a way.
what reason u wanna do that??

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: auto_increment command

am 12.03.2007 02:59:22 von Micah Stevens

--------------000902000805090706090601
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Actually you can. As Bastien pointed out:

ALTER TABLE tbl AUTO_INCREMENT = 1;

This may screw with your indexes though, if you have a primary indexed,
or unique indexed row, and you set this to 1, mysql >>MAY<< try and
insert conflicting values. I've never done this so I have no idea how
this is handled by the server, but I suspect you'll just get an error.

-Micah

On 03/11/2007 06:55 PM, bedul wrote:
> u can't
> ----- Original Message -----
> From: "Ron Piggott"
> To: "PHP DB"
> Sent: Monday, March 12, 2007 7:52 AM
> Subject: [PHP-DB] auto_increment command
>
>
>
>> I am not sure if that last e-mail went through or not. I am wondering
>> how to re-set the auto_increment field back to 1 in one of my tables.
>> Ron
>>
>
> there no such thing reset auto_increment
> if you need the reset.. there were way to do that.
> rename the table.. then take query to build it
> create new table and tralalla.. u have reset it.
>
> fyi. if inside the table already have a data were id was 100.. the next id
> must be 101..
> btw.. if you want to make your table more clean (i said about.. how random
> the num).. there is a way.
> what reason u wanna do that??
>
>

--------------000902000805090706090601--