First of all let me tel you that in MySQL you don't have an option to define
your autonumber value format.

You can use this approach which is flexible:

Make users to enter the autonumber format for each of these: Quote,

Quote - user entere "Q+" as autonumber for for example. In this case
autonumbers for Quotes will be like Q+1, Q+2...etc.. Of course for each of
these autonumber format you have to use a seperate table to store these user
entered values.

Then each time you add a Quote, you will look at that table in order to
understand the autonumber format of the Quote, and add next autonumber
value(Of course autonumber assigned to quote should be stored in the same
row with the current Quote).

Here is what I mean:

ITEM            | USERID       |  FORMAT  | AUTONUMBER_ID (autoincrement)
Quote                  3                    Q +                         1
Project                 3                    P-                            2
Customer              ....              ....                               3
Supplier                ..                ....
Invoice                ....                ...
Quote                  4                    Quote #
Project                 4                    Project #

1                        3             (QUOTE FORMAT WILL BE "Q +
2                        4              (QUOTE FORMAT WILL BE "Quote +

Hope this helps.

Muhammed Mamedov

"Richi Watts" <[EMAIL PROTECTED]> wrote in message

Could someone explain to me how this could be done? I have seen something
similar using Access on a local machine and would like to know if it is
posible to do it in PHP and Mysql
In a project management web based applicaton using PHP and Mysql I would
need to allow the user to create


Each time one of the above will be created it needs to be assigned an
autonumber. So If 3 quotes were created today each quote would receive an
autonumber, maybe something like the fllowing:

Creating the autonumber isn't the problem if I want to have a set way of
numbering, however, is it possible for me to allow the user to enter a setup
page or something and define the way the autonumbers will look like and be
created for quotes, projects, customers, suppliers or invoice.

let's say I have five Project Managers each working with a seperate version
of the app. The app currently sets each new project created with a default
autonumber (let's say yy/MM/dd-01, -02, 03 and so on), however, each Project
Manager wants their database to number new projects differently:

PM1 = yy/MM/dd-a
PM2 = dd/MM/yy-01
PM3=  YY-2222 (Number being the amount of projects this year)
PM4 = PROJ-2222 (Number being the amount of projects ever)
PM5 = P-yyMMdd1

Instead of me creating a different application for each project manager can
I allow them to setup their own number system in a set up page?

Many thanks for any ideas

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to