So let's start the database function to insert a new order, and since it's pretty much the same as
in at least in terms of structure as the insert transaction, I'm just going to copy this entire function
and rename it and then modify it as necessary.
And as you can see, I have my ID split again so that I can see what the order is without having to
switch back and forth with the database just to save some time.
So we'll call this one insert order and change this comment.
And it won't take a transaction as an argument, it will take an order, which I'll call the order.
OK, so insert into orders and as you can see, this has one, two, three, four, five, six, seven
fields.
So we're going to insert widget ID.
And we'll insert transaction into.
And we'll insert status
and quantity.
And the amount of.
And created and updated, so down here, this becomes order, we'll just copy and paste pasted everywhere
and then modify it as necessary.
So the first one is the widget and then the transaction and the status of the
quantity.
And the amount of.
And that really should be all I have to do with this, except that amount is capitalized.
So let's fix that.
OK, so now we have a means of inserting a transaction and that transaction will change its status throughout
the life cycle of the actual full transaction, where we're charging a credit card and the order holds
the order details, including the transaction.
So we have a means of linking between these two.
All right, let's move on.