mysql auto increment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cool84
    New Member
    • Mar 2007
    • 5

    mysql auto increment

    hai,

    1. i need help on how to set the auto incremental
    as "REF0001","REF0 02","REF003",.. .....and so on.

    2. i declare the field as integer but i want the prefix "REF" follow by the
    increment number .

    3. I want every time the user insert their data via the php form the reference number automaticly insert in the mysql database.


    I declare the field in mysql database as

    field -reference_no
    Type-int(11) , auto_increment
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    This is unnecessary. When you do your select statement, add the "REF" string to the front of your ID. You can even pad it with extra zeros if you want.

    Comment

    Working...