|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Order status - pending, completed etc
Hi, i have a newbie question so your kindness would be much appreciated!
I have a question relating to orders. For my database i will have a number of states, ranging from when a customer initially places an order, to the order being assigned to a customer sales representative, then a completed state. Is it better to store a 'state' ie order_pending, order_complete enum type in a database, or is it better to have seperate tables for different states (ie pending table, completed table)? I have been thinking that the state flag idea would be the best of the two, but expert opinion would be great or perhaps some other recommendations for my problem? Many thanks, Chris |
|
#2
|
|||
|
|||
|
Can't you just have a field name 'state'. In it you store any of the 3 states. Like 'rececived', 'Pending' or 'Processed'. That way you could do many things with it. For example, if($row['state'] == 'Pending') {
echo 'order pending';} I am kind of tired, I will come back to this later. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Database Development > Order status - pending, completed etc |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|