[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

mysql auto increment  help needed

Posted on 2011-03-06
3
Medium Priority
?
574 Views
Last Modified: 2012-05-11
Hi

How to set a auto increment value starting like  00001 instead of 1 ?


Thanks
0
Comment
Question by:3xtr3m3d
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
geff_chang earned 668 total points
ID: 35046178
The autoincrement value is a number (an integer).
So, leading 0s does not mean anything.

If you want to have leading 0s displayed in your client / program,
you need to manually format the data to be displayed with leading 0s.
It shouldn't be difficult to do.
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 668 total points
ID: 35046200
I confirm the above statement, leading 0000 are formatting, not data.
0
 
LVL 11

Assisted Solution

by:Ovid Burke
Ovid Burke earned 664 total points
ID: 35046219
You can specify zerofill:

ALTER TABLE `table_name`
MODIFY COLUMN `column_name`  int(10) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT FIRST ;

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question