How to change the Next Autoindex?? Any Help??

How to use phpmyadmin.... phpmyadmin related arguments. Even phpMyAdmin issues

Moderators: egami, macek, gesf

Post Reply
k4pil
New php-forum User
New php-forum User
Posts: 42
Joined: Tue Jul 12, 2005 1:19 pm

Tue Aug 02, 2005 3:13 pm

Hi there!

I have set up a table which has a primary key = ID. now, upon each new entry to the table, each row is assigned a new ID. This ID auto increments by 1. Now, as i am a begginer, i am testing what i can and can't do. This means i end up deleting alot of the rows. I am now at a Next AutoIndex of 252!!!!

Any suggestions on how i can reset this or change this??

I know that i can create a new table, but are there a ny other solutions????

Thanks in advance!!

K4p
I'm a begginer, need all the help i can get!!!

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Tue Aug 02, 2005 3:24 pm

the auto increment is reset when using TRUNCATE TABLE 'table_name'
Note: all data is deleted from the table

In phpMyAdmin there is a link: Empty Table -- it Truncates it
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Tue Aug 02, 2005 3:33 pm

No there's not a way so you can have it ordered.
If you really need those ID's, you wont change them 'cause it will affect something. Otherwise, there's no need to use that auto_increment column.
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Wed Aug 03, 2005 1:55 am

however... i think you can use AUTO_INCREMENT = 50 so it will start from 50.... but i dont remember the syntax..

Hehe..still got my head spinning from my SQL kung-fu yesterday with one script... hehe...
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Thu Aug 04, 2005 8:09 am

all that is good only in case you have a clean table or the autoincrement value you are setting is larger then the highest id number: otherwise they will collide and it might result in some problems
Best Regards,
Alexej Kubarev
-------------------------------
Zend Certified Engineer
Image Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest