0

good day guys,
I have an order table and some stuffs, and the user can cancel an order. my question is:
1.] what is the best implementation of canceling an order in a database? Im sure I must create a table for canceled order or something right?
2.]Is it appropriate to delete the canceled order in the order table and move it to the "tblCancel" or just copy the canceled order to the "tblCancel"?

thanks in advance for your help, Good day!

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by ChrisPadgham
0

I would just add a tinyint field to your orders table that represents the status of the order. 0 = ordered, 1 = cancelled, 2 = shipped etc. Then when you want to view your outstanding orders, just filter according to the status of the order. This implementation allows you to keep a "paper trail" of every order, regardless of whether it was actually carried out.

0

hey, thanks for the reply, so easy.I will try that out now.

//any other ideas are still acceptable :D

0

You are better to put a OrderCancelledDate field in the table. It provides more information to the user. If is is null then the order has not been cancelled.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.