1 00:00:01,090 --> 00:00:06,340 So now what we need to do is that we need to get the order in as it all you hear after we insert this 2 00:00:06,340 --> 00:00:07,360 order into the database. 3 00:00:07,780 --> 00:00:10,270 The database in return will issue a new order. 4 00:00:10,630 --> 00:00:17,980 And we need to get this order in because we will need to use this order ID in order to place each single 5 00:00:17,980 --> 00:00:25,210 element in each single product in the ordered items, because otherwise we wouldn't know which products 6 00:00:25,500 --> 00:00:33,910 the user wants to do to buy because after the user, for example, if the user adds these items, we 7 00:00:33,910 --> 00:00:34,270 will not. 8 00:00:34,480 --> 00:00:41,050 Even if we add an order in the order table, this order will only have we only store user information 9 00:00:41,440 --> 00:00:42,640 as well as the order ID. 10 00:00:43,180 --> 00:00:51,910 But in order to know the order details about that order, we need to store these two or however many 11 00:00:51,910 --> 00:00:56,230 number of items that the user wants in the order items. 12 00:00:56,920 --> 00:01:01,000 Therefore, we need to get the we need to get the order ID from the database. 13 00:01:01,930 --> 00:01:07,840 So to get the order either after it has been inserted, after the order has been inserted, the database, 14 00:01:08,410 --> 00:01:14,110 if you call the is the empty and call a function called insert the database. 15 00:01:15,160 --> 00:01:21,160 After you call insert I.D., the database is going to return the order I order underscore item and I'm 16 00:01:21,160 --> 00:01:22,240 going to prove it to you now. 17 00:01:22,990 --> 00:01:27,010 Now, let me hear say echo and then I'm going to display the order. 18 00:01:27,010 --> 00:01:28,530 It is just for the sake of this thing. 19 00:01:28,750 --> 00:01:36,130 I'm going to say order I.D. By the way, in the check out, we need to say here, action. 20 00:01:36,670 --> 00:01:44,920 And then we need to remove this and we need to say server first server or slash place order because 21 00:01:45,550 --> 00:01:54,340 the check out page is outside the server, whereas the police order that HP is inside the server. 22 00:01:54,730 --> 00:02:01,960 So in order to get to the place order file we need to say server four slash place order that Beechwood 23 00:02:02,770 --> 00:02:08,560 and here in the place order we just get the we just insert the order and the database will return the 24 00:02:08,560 --> 00:02:13,570 order ID and now we just need to do the display, the order ID just for the sake of this thing. 25 00:02:14,020 --> 00:02:16,570 So let me click on file on the table and let's this. 26 00:02:18,230 --> 00:02:23,280 So now suppose that I am a customer and let me remove everything from the card. 27 00:02:24,350 --> 00:02:26,630 And suppose that I'm now a customer. 28 00:02:26,640 --> 00:02:28,580 So I'm going to go to the homepage. 29 00:02:30,420 --> 00:02:31,740 I'm going to go to the homepage. 30 00:02:32,250 --> 00:02:35,660 And then let me, for example, say that they want to buy this item. 31 00:02:35,690 --> 00:02:40,830 I'm going to click on Buy now and then I'm going to click on Add to Cart, and then I'm going to click 32 00:02:40,830 --> 00:02:41,730 on checkout. 33 00:02:42,420 --> 00:02:45,840 So if I click on checkout, it's going to ask me to fill out this form. 34 00:02:45,840 --> 00:02:47,610 So let me fill out this form quickly. 35 00:02:48,060 --> 00:02:53,340 So I have filled this this form quickly and let me click on Place Order. 36 00:02:54,120 --> 00:03:01,110 Again, you will not be able to click on Please Order unless you fill the complete the complete form. 37 00:03:01,530 --> 00:03:05,010 So if you don't feel if you forget to fill one of these, it's not going to work. 38 00:03:05,910 --> 00:03:10,020 So, for example, if you say if you click on place order, it's not going to work. 39 00:03:10,020 --> 00:03:13,230 It's going to tell you, please fill out the form. 40 00:03:13,830 --> 00:03:15,350 So let me click on Place Order. 41 00:03:15,360 --> 00:03:18,540 If I click on Place Order, guess what it's going to display here. 42 00:03:19,200 --> 00:03:21,990 Here, as you can see, it's going to say one. 43 00:03:22,000 --> 00:03:23,190 What does this one mean? 44 00:03:23,640 --> 00:03:27,680 This one means that the order has been inserted into the database. 45 00:03:27,690 --> 00:03:28,440 Let me show you this. 46 00:03:29,130 --> 00:03:34,680 Now, in the orders table, if I refresh the order table, a new order has been placed, as you can 47 00:03:34,680 --> 00:03:37,680 see, and your order has been placed within my information. 48 00:03:37,680 --> 00:03:39,600 So order it is one order. 49 00:03:39,600 --> 00:03:47,160 Cost is 155 order status is on hold because I didn't pay and the order has just been placed. 50 00:03:47,970 --> 00:03:49,980 The user ID is one by default. 51 00:03:50,580 --> 00:03:58,770 The user ID phone number, the city, the address, everything has been stored in the into the database. 52 00:03:59,370 --> 00:04:00,840 So this is how it works. 53 00:04:00,840 --> 00:04:05,970 And now we make sure that the order ID will be returned by the database. 54 00:04:06,360 --> 00:04:09,000 Now we can move on and continue with the other steps.