Forum Moderators: buckworks
I'm building a simple shopping cart for a site that will be selling only a couple of products - No database will be used for this.
We're posting data to a TPV, and need to send in the client ID and an order number to start the transaction - I'm a bit stumped about how to handle the order number...
Without a database or anything to refer to, I could generate an order number by having the user type in their name, and with PHP append a date and time to the name and from that make an order number,
or,
so that they don't have to enter their name twice (here and on the CC submittal) I could just use the date and time and append a couple of random numbers, for example...
And as far as order number duplication, a database with an AUTO_INCREMENT order number is much easier to code as opposed to the code required to lock and update an order number data area or text file. I've done both. My suggestion is to follow the others advice and use a database.
Something else to consider: it may be a
simple shopping cart for a site that will be selling only a couple of productsnow, but as you enhance or move forward, you will likely want to build on your initial development. Another reason to use a database now!
Best of luck with your new system -- Coopster