I'm builing an order management system. They're old system that i'm replacing gives them the NEXT order number when they open a new order.
(ie QuickBooks acts this way)
How can i do the same thing with PHP MySQL. I'm thinking about this SQL query
SELECT num FROM table ORDER BY num DESC LIMIT 1;
that should give me the last number and i can just add one to it.
BUT i do not want to query the DB as this will contains thousands of records and i'm worried about a performance hit.
Is there any other way to achieve this? has anyone encountered this issue before?
I want the user to enter any order number, but automatically suggest the next available one. This way they can "choose" a scheme. If somebody types in O1000, the next sales person should see O1001 when entering a new order.
thanks for your help guys,
DM
(ie QuickBooks acts this way)
How can i do the same thing with PHP MySQL. I'm thinking about this SQL query
SELECT num FROM table ORDER BY num DESC LIMIT 1;
that should give me the last number and i can just add one to it.
BUT i do not want to query the DB as this will contains thousands of records and i'm worried about a performance hit.
Is there any other way to achieve this? has anyone encountered this issue before?
I want the user to enter any order number, but automatically suggest the next available one. This way they can "choose" a scheme. If somebody types in O1000, the next sales person should see O1001 when entering a new order.
thanks for your help guys,
DM
Comment