WEBVTT 00:02.330 --> 00:08.990 So let's start the database function to insert a new order, and since it's pretty much the same as 00:08.990 --> 00:13.910 in at least in terms of structure as the insert transaction, I'm just going to copy this entire function 00:14.270 --> 00:17.420 and rename it and then modify it as necessary. 00:18.230 --> 00:24.170 And as you can see, I have my ID split again so that I can see what the order is without having to 00:24.170 --> 00:26.840 switch back and forth with the database just to save some time. 00:27.620 --> 00:31.640 So we'll call this one insert order and change this comment. 00:38.110 --> 00:44.380 And it won't take a transaction as an argument, it will take an order, which I'll call the order. 00:48.940 --> 00:59.020 OK, so insert into orders and as you can see, this has one, two, three, four, five, six, seven 00:59.020 --> 00:59.500 fields. 00:59.500 --> 01:02.800 So we're going to insert widget ID. 01:05.590 --> 01:07.660 And we'll insert transaction into. 01:10.870 --> 01:12.830 And we'll insert status 01:15.550 --> 01:16.630 and quantity. 01:19.260 --> 01:20.170 And the amount of. 01:22.340 --> 01:29.900 And created and updated, so down here, this becomes order, we'll just copy and paste pasted everywhere 01:30.290 --> 01:32.010 and then modify it as necessary. 01:33.800 --> 01:42.320 So the first one is the widget and then the transaction and the status of the 01:45.290 --> 01:45.980 quantity. 01:49.110 --> 01:50.860 And the amount of. 01:52.180 --> 01:56.370 And that really should be all I have to do with this, except that amount is capitalized. 01:56.400 --> 01:57.210 So let's fix that. 01:58.950 --> 02:05.710 OK, so now we have a means of inserting a transaction and that transaction will change its status throughout 02:05.710 --> 02:12.490 the life cycle of the actual full transaction, where we're charging a credit card and the order holds 02:12.490 --> 02:14.890 the order details, including the transaction. 02:15.160 --> 02:17.590 So we have a means of linking between these two. 02:17.830 --> 02:19.140 All right, let's move on.