Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. increment number

increment number

Scheduled Pinned Locked Moved Database
phpmysqltutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    susanhalim
    wrote on last edited by
    #1

    how to generate field number by increment (+1) in table mysql using PHP after inserting and deleting data? ex: Number 1A (next) 2A 3A

    N P M 3 Replies Last reply
    0
    • S susanhalim

      how to generate field number by increment (+1) in table mysql using PHP after inserting and deleting data? ex: Number 1A (next) 2A 3A

      N Offline
      N Offline
      notes4we
      wrote on last edited by
      #2

      In SQL Server Management Studio (SSMS), in the Object Explorer, connect to your Database Engine, Databases, Expand your Database Name, Expand Tables, Right - click the Table Name in which you wish to have the increment number and select Modify from the context menu. You will see the column names in that particular table. Just select the column where you want the increment number and in the bottom in the Column Properties window, Expand Identity Specification. In the (Is Identity) from the drop down list select Yes and you will see the Identity Increment as 1 by default. That is what you need. If you wish you can change it also to 2 or some other number as you wish. Hope this helps. I was to descriptive to answer this simple question, but I am not sure how much do you know about it, so I thought of starting from the scratch. Good Luck.

      1 Reply Last reply
      0
      • S susanhalim

        how to generate field number by increment (+1) in table mysql using PHP after inserting and deleting data? ex: Number 1A (next) 2A 3A

        P Online
        P Online
        PIEBALDconsult
        wrote on last edited by
        #3

        Are those "A"s part of the "number"? :confused: If so, I don't think the system can do it automatically, you'd have to roll your own.

        1 Reply Last reply
        0
        • S susanhalim

          how to generate field number by increment (+1) in table mysql using PHP after inserting and deleting data? ex: Number 1A (next) 2A 3A

          M Offline
          M Offline
          mahsa shahi
          wrote on last edited by
          #4

          why you dont declare the column in the design of table auto increamnet ?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups