kevinritt Posted February 12, 2007 Share Posted February 12, 2007 I have an order for for customers to fill out. What I'd like to do is have a customer order number automatically generated each time the form page is opened. I then want to send that number with the order to the database. How would I create this? The number can be random or sequential. For example, customer A orders and gets customer number: 1234 then customer B orders and gets customer number: 5678 and so on. Appreciate any help Link to comment https://forums.phpfreaks.com/topic/38230-counter-variable/ Share on other sites More sharing options...
jcbarr Posted February 12, 2007 Share Posted February 12, 2007 Are you entering this data in to a database? If so then you can set a column named order_id and have it autoincrement, then every time a row is added to the database that number is incremented by one. Link to comment https://forums.phpfreaks.com/topic/38230-counter-variable/#findComment-183108 Share on other sites More sharing options...
kevinritt Posted February 12, 2007 Author Share Posted February 12, 2007 Thanks, I'm already doing that. I need to use this number to give to the customer at time of order (before it goes into the database) Link to comment https://forums.phpfreaks.com/topic/38230-counter-variable/#findComment-183123 Share on other sites More sharing options...
redarrow Posted February 12, 2007 Share Posted February 12, 2007 put the number in a session then display on another page with order info. Link to comment https://forums.phpfreaks.com/topic/38230-counter-variable/#findComment-183124 Share on other sites More sharing options...
kevinritt Posted February 12, 2007 Author Share Posted February 12, 2007 thanks can you lead me to a tutorial that shows me how to do this? Link to comment https://forums.phpfreaks.com/topic/38230-counter-variable/#findComment-183126 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.