Add digits to auto increment database field

Asked

Viewed 28 times

0

I need to add in the Mysql database id field, which is auto increment, the value 0 up to 4 digits - will serve as invoice number.

In the form I do not handle this item, it has to be directly in the database or add the digits via code but without entering this field in the form as it does not need to be manipulated.

  • But at what point? In a select? Want to update? Need to be more specific.

  • 2

    Are you going to put "0" on the left or right? There will be no left-hand effects in numeric fields, and if you go right, and you already have records, you can duplicate. In any case, auto incremented ID field does not move (likely to be PK key). Why not create a field for this?

  • 3

    I believe that that answer resolve.

  • @rray, that’s what I need. Thank you

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.