Sequential numbers - a real challenge

K

Ken

This is a challenge. Perhaps someone can offer suggestions.

I am trying to create a variable, ordernumber, that increases by an
increment of 1 every time the variable is accessed.

For example:
Call up the variable the first time: ordernumber = 1

"Reopen" the webpage, call up the variable a second time: ordernumber = 2,
etc.

I am trying to create sequential order numbers without using the date or the
alphabet. I would like the order number to be a max of 6 numeric digits.

The problem I am having is finding a way for the ordernumber to be
remembered on the server, so when I call it up the next time, it can be
incremented by 1.

Thanks for the thoughts.

Ken
 
J

Jeff North

| This is a challenge. Perhaps someone can offer suggestions.
|
| I am trying to create a variable, ordernumber, that increases by an
| increment of 1 every time the variable is accessed.
|
| For example:
| Call up the variable the first time: ordernumber = 1
|
| "Reopen" the webpage, call up the variable a second time: ordernumber = 2,
| etc.
|
| I am trying to create sequential order numbers without using the date or the
| alphabet. I would like the order number to be a max of 6 numeric digits.
|
| The problem I am having is finding a way for the ordernumber to be
| remembered on the server, so when I call it up the next time, it can be
| incremented by 1.
|
| Thanks for the thoughts.

You shouldn't rely on the web page to hold such information.
Reason 1: if I click on the back/forward buttons on the browser this
will alter the number on not reflect the 'true' value to store.

Reason 2: if 20 people access the page at the same time then they will
all be given the same number. When then store their information then
they might end up with the same order number.

Let your database handle this auto-incrementing number.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top