Board index   FAQ   Search  
Register  Login
Board index php forum :: Database phpMyAdmin

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

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

Moderators: macek, egami, gesf

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

Postby k4pil » 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
k4pil
New php-forum User
New php-forum User
 
Posts: 42
Joined: Tue Jul 12, 2005 1:19 pm

Postby Alexej Kubarev » 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
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby gesf » 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.
User avatar
gesf
Moderator
Moderator
 
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden

Postby Alexej Kubarev » 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...
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Postby Alexej Kubarev » 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
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län


Return to phpMyAdmin

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.