[thelist] generating an order #

Jeremy Weiss jweiss03 at comcast.net
Tue Jan 7 01:05:01 CST 2003


I'm writing some scripts to do online credit card processing.  The processor
requires that I pass them an order number along with everything else and I'm
not quite sure how to go about creating an order number.

My first thought was to just use the autonumber field for the record as it's
added to the database but when an existing customer returns to order more,
then new order is listed along with the same id.

So then I thought about just generating a random number, but then I run into
the problem of unique order #'s.

My next thought is to generate a GUID, but those are waaaaay longer than
what I'd like. I'm only thinking 5 digits, 6 max.

I'm not really looking for the code, just an idea on how to best do this.
Of course a little code never hurt either. ;)

TIA,
Jeremy Weiss





More information about the thelist mailing list