473,396 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sequential numbers - a real challenge

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

Jul 20 '05 #1
2 2609
In article <mt****************@twister.rdc-kc.rr.com>,
"Ken" <kk******@wi.rr.com> wrote:
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


You will need to do this in a server script.

On the client, you could create a cookie with a number in it but be
aware that the user can delete or disable cookies.

Robert
Jul 20 '05 #2
On Thu, 12 Feb 2004 21:44:50 GMT, in comp.lang.javascript "Ken"
<kk******@wi.rr.com> wrote:
| 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.
---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andreas | last post by:
Hi! I'm writing a program that has support for multiple language, so far swedish and english is requested. Everything is fine, but the program has to be able to run on computers with...
6
by: Jenn L | last post by:
I have a database that is pre-populated with sequential part numbers. As people reserve the parts I update a flag to show the # is no longer available. Now they want the ability to take out a...
5
by: Lapchien | last post by:
I have list of numbers in a table (originally from autonumber in a different database) from 1 to 1,000,000. The list is not in sequential order - there are loads of numbers missing. How can I...
14
by: amywolfie | last post by:
Hi All: I know this is simple, but I just can't seem to get there: I need to sort a table by a text field (txtDescription), then assign sequential numbers to the field SEQUENCE in table. ...
19
by: eric.nave | last post by:
this is a slight change to a fequently asked question around here. I have a table which contains a "sortorder" column where a user can specify some arbitrary order for records to be displayed in. ...
4
by: Bruce | last post by:
Surely someone has done this before, and I am guessing there is a simple solution that is eluding me. I have a simple report based on a recordset. For each record there is a field (RecNum) that...
1
maxamis4
by: maxamis4 | last post by:
Hello folks, I have two forms a parent form and a subform. The parent form is an unbound form while the subform is a form that contains all a list of what I like to call 'in stock ' phone...
6
by: jtidwell | last post by:
I am developing a Work Order Database for my job. I have a combo box with "Contract Numbers" to select from. When you select on any Contract Number I need a new "Work Order Number" to appear. There...
9
by: Axxe | last post by:
I have searched high and low for cogent, well-explained coding to complete a project on which I have spent six months of work. I stumbled across something on this site that is close to what I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.