Re: Creating an autonumber setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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,
Project,Customer,Supplier,Invoice

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:

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

QUOTE_TABLE
----------------------------------
QUOTE_ID | USERID |
---------------------------------
1                        3             (QUOTE FORMAT WILL BE "Q +
somenumber")
2                        4              (QUOTE FORMAT WILL BE "Quote +
somenumber")



Hope this helps.

Sincerely,
Muhammed Mamedov





"Richi Watts" <richiwatts@hotmail.com> wrote in message
Law12-OE70QQ33h6rZ40003d49d@hotmail.com">news:Law12-OE70QQ33h6rZ40003d49d@hotmail.com...
Hi,

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

Quote
Project
Customer
Supplier
Invoice

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:
yy/MM/dd-01
yy/MM/dd-02
yy/MM/dd-03

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
Richi

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux