1 00:00:00,720 --> 00:00:06,750 So now in the edit product page, this page, we need to activate this form and we also need to get 2 00:00:06,750 --> 00:00:11,160 the product information first and display the old information, the all the details here. 3 00:00:11,790 --> 00:00:16,110 So to get the old details, we can make a query or pass. 4 00:00:16,110 --> 00:00:19,320 Pass the old query, pass the old data from here. 5 00:00:19,800 --> 00:00:24,900 We can pass the old data from here or we can make a new query from this page. 6 00:00:24,900 --> 00:00:27,300 So let's create a new query here because it's easy. 7 00:00:27,300 --> 00:00:29,190 I think it's not going to take any time. 8 00:00:29,760 --> 00:00:35,040 You can then use a BGP and then remember the code is here. 9 00:00:35,520 --> 00:00:36,990 You can copy the code from here. 10 00:00:37,410 --> 00:00:37,980 This could. 11 00:00:40,770 --> 00:00:49,830 And then they sit here and I'm just going to say a statement, one statement, one statement, not even 12 00:00:49,830 --> 00:00:50,190 one. 13 00:00:52,530 --> 00:01:06,750 And then I'm going to say select, select all from products where where product underscore ID is equal 14 00:01:06,750 --> 00:01:07,710 to the product ID. 15 00:01:08,640 --> 00:01:12,600 So the product ID, we got the product ID from the page from the get request. 16 00:01:12,600 --> 00:01:15,990 I'm going to say here, if we have the get. 17 00:01:20,280 --> 00:01:23,490 Yet, then I'm going to say product. 18 00:01:24,930 --> 00:01:25,560 Their score. 19 00:01:25,800 --> 00:01:30,900 If we have this, we can now add this code inside. 20 00:01:33,560 --> 00:01:34,190 Else. 21 00:01:35,210 --> 00:01:37,490 We can't say either. 22 00:01:40,200 --> 00:01:45,780 And then products that HP and then exit. 23 00:01:49,280 --> 00:01:56,060 And here prepare, prepare, select oil from products where the idea is equal is equal to the product 24 00:01:56,060 --> 00:01:56,290 idea. 25 00:01:56,320 --> 00:01:57,800 So I'm going to create a variable here. 26 00:01:59,120 --> 00:02:02,720 Product I need is equal to get. 27 00:02:05,100 --> 00:02:05,410 80. 28 00:02:09,300 --> 00:02:15,420 And then we pass here the product lady or we add a question mark, and then in a new line we can say 29 00:02:15,420 --> 00:02:28,250 statement bind Sara, bind Bahram and then we bind the S, the I, the product ID and then comma product. 30 00:02:32,140 --> 00:02:34,660 And then he don't forget to say statement. 31 00:02:34,750 --> 00:02:35,590 Get results. 32 00:02:36,700 --> 00:02:37,450 Pretty simple. 33 00:02:37,930 --> 00:02:42,310 Lastly, we need to say here, products, not products, product singular. 34 00:02:42,880 --> 00:02:48,580 And then in the bottom, we need to display the old information about all product information. 35 00:02:49,000 --> 00:02:56,590 So instead of displaying in the fields with the values here, the title is going to be here value and 36 00:02:56,590 --> 00:03:02,410 the value is going to be equal to each B and then product. 37 00:03:05,850 --> 00:03:11,190 Then we need to copy this card, this value and paste it in every single field we have. 38 00:03:11,190 --> 00:03:15,900 We have here the product description, description. 39 00:03:17,010 --> 00:03:18,810 And then we have the product price. 40 00:03:20,790 --> 00:03:21,360 Well elect. 41 00:03:22,470 --> 00:03:22,790 Right. 42 00:03:23,700 --> 00:03:25,070 And then we have a category. 43 00:03:25,080 --> 00:03:25,830 The category. 44 00:03:27,260 --> 00:03:29,860 A is going to be here. 45 00:03:29,870 --> 00:03:33,110 This is a little tricky, but I'm going to work on it later. 46 00:03:33,860 --> 00:03:37,370 And then the color I'm going to say your valley. 47 00:03:37,580 --> 00:03:39,650 I'm going to say your product, product, color. 48 00:03:42,050 --> 00:03:47,660 And then for the special offer, I'm going to say product, special offer. 49 00:03:52,620 --> 00:03:55,520 And then added Barron, It's just going to be Ed Baron. 50 00:03:55,530 --> 00:03:56,760 We don't have to do anything. 51 00:03:57,300 --> 00:03:59,060 Lastly, we need to add two things. 52 00:03:59,070 --> 00:04:03,180 First, we need to say Echo, and then we need to hear. 53 00:04:03,300 --> 00:04:10,200 Also say Echo, and here we need to say Echo, and here we need to say echo. 54 00:04:11,610 --> 00:04:12,840 And here as well. 55 00:04:12,840 --> 00:04:13,260 Echo. 56 00:04:16,400 --> 00:04:23,000 And lastly, we need to add a loop, because even though this is not a this this is NRA. 57 00:04:23,240 --> 00:04:28,760 Only one of only one of only one object. 58 00:04:29,360 --> 00:04:30,420 Of only one object. 59 00:04:30,440 --> 00:04:31,760 Therefore, we need to add a loop here. 60 00:04:32,570 --> 00:04:35,990 So I'm going to say here for each or each. 61 00:04:39,340 --> 00:04:40,780 First we need to each be. 62 00:04:43,610 --> 00:04:45,470 For each. 63 00:04:48,890 --> 00:04:49,700 Right acts. 64 00:04:52,050 --> 00:04:52,770 As. 65 00:04:56,080 --> 00:04:58,270 Let's say pride acts as. 66 00:04:59,360 --> 00:04:59,990 Product. 67 00:05:01,420 --> 00:05:08,140 And then I then clearly bracket and then BHP and then we close it at the end, we close it here. 68 00:05:10,940 --> 00:05:11,990 We close it here? 69 00:05:14,520 --> 00:05:17,310 However, we need to edit something very important. 70 00:05:19,430 --> 00:05:24,410 When we need to edit something very important, which is the name of the variable. 71 00:05:25,250 --> 00:05:28,220 So the name of the variable at the top it should be products. 72 00:05:28,250 --> 00:05:33,470 Now, even though it's, it's, it's one product, I'm going to get only one product. 73 00:05:33,470 --> 00:05:35,970 But here I'm going to say products because it's going to be an array. 74 00:05:36,020 --> 00:05:37,280 This is going to return an array. 75 00:05:38,120 --> 00:05:40,880 ZELENY I'll save the other over to the browser to test. 76 00:05:41,600 --> 00:05:43,460 So now in the browser, let me refresh. 77 00:05:44,500 --> 00:05:48,820 I'll click on edit and if you click on it, it's going to display the old information. 78 00:05:48,820 --> 00:05:53,410 So you're just going to play the details of the product. 79 00:05:53,410 --> 00:05:55,990 Actually, here it should say product. 80 00:05:56,470 --> 00:05:57,970 I shouldn't be saying it. 81 00:05:58,600 --> 00:06:01,120 I should say product name here, product name. 82 00:06:02,560 --> 00:06:04,210 So let me refresh one more. 83 00:06:04,210 --> 00:06:05,830 Let me go and refresh one more time. 84 00:06:08,480 --> 00:06:08,870 Now. 85 00:06:08,870 --> 00:06:10,460 I couldn't get the old information. 86 00:06:10,880 --> 00:06:14,150 If I click on edit, I'm going to give you all information here. 87 00:06:14,150 --> 00:06:15,110 Giving back. 88 00:06:15,130 --> 00:06:15,680 Awesome. 89 00:06:15,680 --> 00:06:19,130 Giving back 155 bags wide. 90 00:06:19,130 --> 00:06:21,860 And that special offers you the next thing. 91 00:06:21,860 --> 00:06:27,230 That thing that we need to do is that we need to activate this edit button so that the user will be 92 00:06:27,230 --> 00:06:31,940 able or the admin will be able to edit information regarding this product.