Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Autoincrement, and starting autoindex value of 0

Status
Not open for further replies.

jerijeri

Programmer
Sep 11, 2002
33
CA
Hi,

I have certain tables where I'd like the record id to autoincrement and start at 0.

0 would recommend someone who doesn't have access
1 and above have different access privileges.

There are new levels added, hence the desire to use Auto-increment. The problem comes when I use SQL dumps to move the table to a new server.

Everytime the there is a 0 in the index, it wants to set it to 1 instead. If I manually edit to 0, it's fine.

When I create the table, I see (in PHPMyAdmin) "Next Autoindex 1"

Is there any way to start the autoindex at 0.

Thanks,

Jer
 
To use auto_increment for this purpose is not suitable. You should not attach any semantic meaning to an auto_increment number, they should just be used to get an arbitray unique value.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top