1 00:00:00,790 --> 00:00:06,940 So here's what I'm going to do, is that I'm going to display a speaker to listen to to display a success 2 00:00:07,040 --> 00:00:08,800 and failure messages. 3 00:00:09,250 --> 00:00:14,890 So here I'm going to say F is set if a set. 4 00:00:16,140 --> 00:00:19,050 And then get, get. 5 00:00:20,530 --> 00:00:21,130 Edit. 6 00:00:22,710 --> 00:00:26,100 Success, massive thing. 7 00:00:26,100 --> 00:00:36,990 What I I'm going to do is that I'm going to use AP and then in this paragraph I'm going to say BHP and 8 00:00:36,990 --> 00:00:41,340 then Echo and then I'm going to echo the message. 9 00:00:41,340 --> 00:00:44,010 I'm going to see Echo edit. 10 00:00:45,860 --> 00:00:47,000 Success. 11 00:00:48,940 --> 00:00:49,480 Message. 12 00:00:51,750 --> 00:00:53,360 And I'm going to adhere to this message. 13 00:00:53,370 --> 00:00:55,680 I'm going to have the class take center. 14 00:00:57,370 --> 00:01:00,380 Take centre and colour, so the colour is going to be green. 15 00:01:00,400 --> 00:01:07,990 I'm going to say style colour green and then I'm going to close the BHP here. 16 00:01:08,860 --> 00:01:12,610 Got BHP Caitlyn bracket and then close this. 17 00:01:12,940 --> 00:01:16,480 And in case of failure, in case we have an error and we want to display an error, I'm going to copy 18 00:01:16,480 --> 00:01:17,290 the same code again. 19 00:01:17,290 --> 00:01:20,160 I'm going to base it below, but I'm going to change here. 20 00:01:20,170 --> 00:01:21,460 I'm going to say I'm going to change the key. 21 00:01:21,910 --> 00:01:27,430 I'm going to say edit failure message, failure message. 22 00:01:27,430 --> 00:01:35,410 And here I'm going to also say edit failure message and the colour is going to be red. 23 00:01:36,430 --> 00:01:38,440 Now back to the edit product. 24 00:01:39,100 --> 00:01:49,360 Now in the edit product, we we need to say if, if statement execute, if it's true, then we need 25 00:01:50,260 --> 00:01:56,920 we need to say, hey there, we need to copy this and then paste it inside. 26 00:01:58,580 --> 00:02:02,450 And then we need to say products and then it. 27 00:02:03,880 --> 00:02:11,590 Success message event is equal to product has been. 28 00:02:13,090 --> 00:02:13,990 I'm Nathan. 29 00:02:15,330 --> 00:02:16,530 Successfully. 30 00:02:19,350 --> 00:02:23,360 In case of a failure, I'm going to say else they don't get a copy. 31 00:02:23,370 --> 00:02:27,660 I'm going to believe this and I'm going to copy the same exact line. 32 00:02:27,660 --> 00:02:30,680 This line, however, the key is going to be different. 33 00:02:30,750 --> 00:02:36,330 The request is going to be a red failure message. 34 00:02:37,410 --> 00:02:38,880 Failure message. 35 00:02:38,880 --> 00:02:41,330 And then I'm going to say error occurred. 36 00:02:43,960 --> 00:02:46,480 Error occurred. 37 00:02:47,960 --> 00:02:48,560 Try again. 38 00:02:49,250 --> 00:02:49,790 Try. 39 00:02:51,540 --> 00:02:52,020 Again. 40 00:02:53,460 --> 00:03:00,170 And lastly, we need to we need to fix three things actually here in this statement. 41 00:03:00,180 --> 00:03:03,840 Update Product set, product name, product description. 42 00:03:03,840 --> 00:03:04,770 Here I have a problem. 43 00:03:05,040 --> 00:03:09,180 I forgot to say here product price is equal to question mark. 44 00:03:09,690 --> 00:03:11,760 Also here, product offer. 45 00:03:11,760 --> 00:03:14,310 It should be product special. 46 00:03:16,280 --> 00:03:24,260 A special offer because in the database its project underscore special underscore offer. 47 00:03:24,770 --> 00:03:27,500 So this this this is a big problem. 48 00:03:27,860 --> 00:03:34,130 Another thing that they want to fix is here, I should say actually, I should you say is set a set 49 00:03:34,130 --> 00:03:35,930 get project ID. 50 00:03:36,980 --> 00:03:41,750 Similarly in the else I'm going to say is set. 51 00:03:42,900 --> 00:03:47,010 Is said past a edit button. 52 00:03:47,940 --> 00:03:54,720 And the last thing that I want to fix is the product. 53 00:03:55,530 --> 00:03:56,710 The product idea. 54 00:03:57,300 --> 00:04:02,280 Since since I'm going to make the request on the same page, the product idea is going to be null. 55 00:04:02,630 --> 00:04:10,170 Therefore, we need to store it in the form, in a hidden in here, in a hidden field. 56 00:04:10,180 --> 00:04:12,060 I'm going to say input. 57 00:04:13,380 --> 00:04:24,900 And then I'm going to say your name is equal to product underscore ID and the value is equal to. 58 00:04:27,490 --> 00:04:30,010 BHP Echo. 59 00:04:32,060 --> 00:04:32,600 Project. 60 00:04:35,200 --> 00:04:36,040 Product. 61 00:04:37,030 --> 00:04:37,780 Product I.D.. 62 00:04:43,790 --> 00:04:47,690 And lastly, we need to give a name to this. 63 00:04:50,460 --> 00:04:51,510 To this input. 64 00:04:51,510 --> 00:04:53,910 We need to say we need to give it another name. 65 00:04:53,910 --> 00:04:55,020 We need to give it a type. 66 00:04:55,860 --> 00:05:00,780 Type so the type would be hidden. 67 00:05:02,420 --> 00:05:03,590 It should be hidden. 68 00:05:04,280 --> 00:05:06,410 So we have a tape, we have a name and we have a value. 69 00:05:06,890 --> 00:05:07,490 Add it up. 70 00:05:07,490 --> 00:05:16,220 We need to get the product ID, I'm going to say here, product I.D. So the product ID is going to be 71 00:05:16,220 --> 00:05:17,720 now equal to past. 72 00:05:19,330 --> 00:05:20,470 And then product. 73 00:05:22,180 --> 00:05:24,770 Product I.D.. 74 00:05:26,050 --> 00:05:27,460 And he reposted the product. 75 00:05:27,460 --> 00:05:28,600 And I. 76 00:05:29,350 --> 00:05:31,120 And don't forget the semicolon. 77 00:05:31,510 --> 00:05:32,230 Now, it should. 78 00:05:32,500 --> 00:05:33,760 Everything should be perfect. 79 00:05:33,760 --> 00:05:34,540 Let me save everything. 80 00:05:34,630 --> 00:05:36,580 Let's say then over to the browser to test. 81 00:05:37,360 --> 00:05:40,630 So now in the browser, let me refresh first. 82 00:05:41,770 --> 00:05:43,330 Let me edit a product. 83 00:05:43,330 --> 00:05:46,000 For example, in the end of the first product, I'm going to click on edit. 84 00:05:46,810 --> 00:05:50,770 Now let me here, for example, say yellow instead of white, I'm going to say yellow shoots. 85 00:05:51,400 --> 00:05:52,510 If I click on edit. 86 00:05:54,100 --> 00:06:01,090 As you can see, it's as a product has been updated successfully and he uses yellow shoots and you can 87 00:06:01,090 --> 00:06:05,380 edit of course the price me it at the price I'm going to say 155. 88 00:06:05,440 --> 00:06:10,780 I'm going to say 195.5. 89 00:06:11,530 --> 00:06:16,440 And you can either be category, let me say shoes and you can edit the color. 90 00:06:16,460 --> 00:06:19,360 The color you can say yellow. 91 00:06:20,530 --> 00:06:24,300 And the offer could be anything, let's say 50% off. 92 00:06:25,240 --> 00:06:26,590 And then if they click on it, it. 93 00:06:27,970 --> 00:06:29,080 Or I should say, by the way, he. 94 00:06:29,100 --> 00:06:29,520 I should. 95 00:06:30,690 --> 00:06:31,800 This should be. 96 00:06:33,570 --> 00:06:33,810 Here. 97 00:06:33,860 --> 00:06:37,590 It says, let me type it one more time. 98 00:06:38,250 --> 00:06:39,120 And it should. 99 00:06:39,120 --> 00:06:39,570 It should. 100 00:06:40,320 --> 00:06:41,640 I think it should be. 101 00:06:43,410 --> 00:06:43,890 It should be. 102 00:06:43,890 --> 00:06:48,930 It should be a number, not a not a decimal. 103 00:06:48,930 --> 00:06:50,000 So we need to fix this. 104 00:06:50,010 --> 00:06:54,960 I'm going to be fixing this because now if I click on edit, it's not going to work because this allows 105 00:06:54,960 --> 00:06:56,370 only numbers. 106 00:06:56,370 --> 00:06:59,130 And to fix this we can simply change. 107 00:07:00,160 --> 00:07:06,990 Change the the type the type of the price to to text. 108 00:07:07,010 --> 00:07:07,810 Simple text. 109 00:07:08,950 --> 00:07:10,210 So this should be a text. 110 00:07:12,000 --> 00:07:18,960 And for now, I'm just going to pass a real number, a complete number on it says 155. 111 00:07:19,530 --> 00:07:20,310 Yellow shoes. 112 00:07:20,310 --> 00:07:25,800 Let me now try with the new with this field. 113 00:07:25,800 --> 00:07:37,050 So if I say one 95.5 and click on edit, it will be one one, 95.1 95.5. 114 00:07:37,080 --> 00:07:38,220 So it works successfully.