Add a new field in database and increment by 1 with each new order
Posted on 2006-07-13
I used Dreamweavers Cartweaver extension to create a shopping cart. It created database and all necessary php files.
It is working but I have a few problems.
It generated a very long order id using many different data such as a prefix (char) customer id , order etc. The autogenerated order_id is a long number including characters and digits. Same order_id is used on invoices and displaying the order.
I want the order number a simple 4 digit number.
I want to add a new field "Order Number" and based on every new Order Id generated. I want the new order number a 4 digit number, which increments by 1 with each new order.
This order number can be used to print on invoices. The autogenerated Order ID can be hidden on the invoice.
I am new to pHp and have just working knowledge.
Please help me create a new field in the order processing and increment it with 1 with each new order.