Pro.Luv Posted August 6, 2008 Share Posted August 6, 2008 Hi, How can I create a simple ordernumber number system for customers? I want the ordernumber to always change for different customers but I don't want to generate a new ordernumber if the current 1 hasn't been bought with... Like.. Ordernumber: 001 I buy a TV with that ordernumber 001 it must automatically change to 002 for the next customer example: Ordernumber : 001 I checkout with ordernumber 001 after I pay... the details get stored in my database with the ordernumber 001 assigned to the order.. If I got and buy another product.. Ordernumber: 002 (this ordernumber changed cause someone already bought with ordernumber 001) Please Help Link to comment https://forums.phpfreaks.com/topic/118394-ordernumber/ Share on other sites More sharing options...
discomatt Posted August 6, 2008 Share Posted August 6, 2008 Take a look at auto increment and unsigned zerofill. Link to comment https://forums.phpfreaks.com/topic/118394-ordernumber/#findComment-609317 Share on other sites More sharing options...
MasterACE14 Posted August 6, 2008 Share Posted August 6, 2008 or if your not using a database as such. grab the latest order number, and increment it by 1. $ordernum = $ordernum++; Link to comment https://forums.phpfreaks.com/topic/118394-ordernumber/#findComment-609327 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.