Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 543467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:33:16+00:00 2026-05-13T10:33:16+00:00

I would like to create a number like: 000000000001 to save to the database.

  • 0

I would like to create a number like:

000000000001

to save to the database. I obviously cannot increment in this fashion (I don’t think) in a database, so I’m looking for the most efficient method for pulling the previous number from the database and incrementing it by 1 to create the next record:

000000000002

and so on…

If I store the first number manually, can I do some sort of manual typing to make it hold its number of zeros? I don’t even know where to start.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:33:17+00:00Added an answer on May 13, 2026 at 10:33 am

    All the leading zeroes are just formatting.

    >>> "%012d" % ( 1, )
    '000000000001'
    >>> "%012d" % ( 2, )
    '000000000002'
    

    Use an ordinary integer and format it to have lots of leading zeroes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form on which I would like to create a dynamic number
I would like to create a bar chart displaying the number of objects that
I would like to create some kind of structure to reduce the number of
I would like to create this shape using just css. I am pretty sure
I would like to create a function floor(number, step), which acts like : floor(0,
I would like to create a nil function that takes any number of symbols
I am trying to create a number of jQuery dialogs but I would like
I would like to create a cascading tree/list of N number of children for
I would like to create a function that takes a variable number of void
I would like to know if there is a way to create any number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.