1 00:00:01,170 --> 00:00:03,710 So now what they need to do is that we need to work on this section. 2 00:00:03,720 --> 00:00:08,730 So this section has these codes and we need to get the codes from the database. 3 00:00:09,480 --> 00:00:19,680 So in my in order to get the courts, we need to create a new file here in the server called Get Underscore 4 00:00:19,680 --> 00:00:20,250 Codes. 5 00:00:21,520 --> 00:00:27,670 That impeachment and the code is going to be similar to the featured products, but there will be something 6 00:00:27,670 --> 00:00:29,740 different and important as well. 7 00:00:30,250 --> 00:00:37,240 So the difference is that the air we select all from from products limit for however we need to say 8 00:00:37,240 --> 00:00:39,700 here where we're. 9 00:00:41,240 --> 00:00:42,830 And then we need to add a condition. 10 00:00:43,130 --> 00:00:45,110 So we don't want to get all products. 11 00:00:45,110 --> 00:00:46,670 We need to get only goods. 12 00:00:47,060 --> 00:00:49,880 So we need to say where category? 13 00:00:52,920 --> 00:00:53,550 Category. 14 00:00:55,080 --> 00:00:58,380 Category category is equal to. 15 00:00:59,160 --> 00:01:01,110 Category is equal to. 16 00:01:01,590 --> 00:01:01,830 Its. 17 00:01:03,260 --> 00:01:06,580 But so we need to say category is equal to God. 18 00:01:06,590 --> 00:01:07,760 So this is very important. 19 00:01:09,490 --> 00:01:11,920 And we are good to go. 20 00:01:11,950 --> 00:01:12,520 That's it. 21 00:01:12,760 --> 00:01:19,120 We need to limit the four limit to four, because we have only here for we can only display here four. 22 00:01:19,810 --> 00:01:23,380 And finally, we need to say here quotes products. 23 00:01:27,920 --> 00:01:28,610 Courts. 24 00:01:30,300 --> 00:01:30,830 That's it. 25 00:01:30,840 --> 00:01:31,830 Very, very simple. 26 00:01:32,670 --> 00:01:39,020 Now, in the index, we need to look for the records. 27 00:01:39,060 --> 00:01:41,610 I think Big Lots has records. 28 00:01:41,620 --> 00:01:49,140 So we have the addresses and codes we need to to do the same way as we did with the with the featured 29 00:01:49,140 --> 00:01:49,500 products. 30 00:01:49,500 --> 00:01:51,660 We need to remove all products and keep only one. 31 00:01:52,350 --> 00:01:54,060 So what I'm going to do is that. 32 00:01:55,160 --> 00:02:00,320 I'm going to keep this product and remove the other for the other three. 33 00:02:00,830 --> 00:02:02,960 So I'm going to remove this and this. 34 00:02:04,650 --> 00:02:05,160 And this. 35 00:02:06,030 --> 00:02:09,150 So we should have now only one product. 36 00:02:10,370 --> 00:02:11,870 So I'm going to add to your space. 37 00:02:12,110 --> 00:02:15,920 I'm going to have your space to show you that this is a product. 38 00:02:16,370 --> 00:02:16,910 Let me say. 39 00:02:18,340 --> 00:02:23,920 Now let me make sure that I my credit is not broken, so my code is fine. 40 00:02:23,920 --> 00:02:25,210 So we have only one product. 41 00:02:25,660 --> 00:02:28,160 Now we need to include here. 42 00:02:28,240 --> 00:02:33,130 We need to say B2B and then include. 43 00:02:36,120 --> 00:02:36,840 Include. 44 00:02:37,500 --> 00:02:38,790 And we need to include. 45 00:02:38,820 --> 00:02:40,050 What do we need to include? 46 00:02:40,080 --> 00:02:41,160 We need to include the. 47 00:02:43,200 --> 00:02:48,330 Server four slash get cuts. 48 00:02:49,630 --> 00:02:51,850 And we need to do the same. 49 00:02:51,850 --> 00:02:56,900 We need to add a little prep each week and then while for. 50 00:02:58,900 --> 00:03:06,760 While only upping the ante clearly bracket and the you're in the classic yearly bracket at the bottom 51 00:03:07,150 --> 00:03:18,940 each week and then clearly bracket while raw, is equal to Y or is equal to the. 52 00:03:18,970 --> 00:03:22,930 Remember, the name of the variable is gots products. 53 00:03:26,290 --> 00:03:27,310 What's. 54 00:03:31,290 --> 00:03:31,920 Products. 55 00:03:32,370 --> 00:03:35,580 And then I'm going to call a function called Fetch a source. 56 00:03:36,420 --> 00:03:36,930 That's it. 57 00:03:36,960 --> 00:03:41,450 Now we need to replace this with the the image. 58 00:03:41,460 --> 00:03:44,100 First, I'm going to say here BHP. 59 00:03:46,190 --> 00:03:47,450 And then echo. 60 00:03:49,260 --> 00:03:51,330 And we need to echo the roar. 61 00:03:54,490 --> 00:03:55,450 Product image. 62 00:03:58,130 --> 00:04:03,560 Right act, underscore image and then cynical. 63 00:04:04,750 --> 00:04:08,980 For the for the name we need to say. 64 00:04:09,190 --> 00:04:16,240 Reach me again and then echo raw product. 65 00:04:20,390 --> 00:04:20,840 Name. 66 00:04:24,050 --> 00:04:24,710 Rice. 67 00:04:27,530 --> 00:04:28,100 BHP. 68 00:04:30,970 --> 00:04:31,540 Erica. 69 00:04:36,540 --> 00:04:38,850 Fried rice. 70 00:04:44,240 --> 00:04:45,440 That's it's pretty simple. 71 00:04:46,100 --> 00:04:49,790 Let me save and let me refresh and show you how this is going to look like. 72 00:04:50,120 --> 00:04:53,810 By the way, I will get nothing and I'm going to explain why I'm going to get nothing. 73 00:04:54,290 --> 00:04:55,110 Let me refresh. 74 00:04:55,130 --> 00:04:58,520 And if I get nothing, as you can see, I got nothing. 75 00:04:59,000 --> 00:04:59,990 Even I got an error. 76 00:04:59,990 --> 00:05:01,700 I have here an error on line eight. 77 00:05:02,150 --> 00:05:08,150 Here it says on code error call to remember boolean or. 78 00:05:08,450 --> 00:05:10,620 Yes, this error is because I got nothing. 79 00:05:10,640 --> 00:05:11,840 Why did I get nothing? 80 00:05:12,260 --> 00:05:14,990 Because I don't have any quotes in the database. 81 00:05:15,830 --> 00:05:18,340 I hear I'm telling my database. 82 00:05:18,350 --> 00:05:19,100 Hey, my database. 83 00:05:19,100 --> 00:05:22,010 I want you to return me all codes from. 84 00:05:22,010 --> 00:05:22,760 From the factories. 85 00:05:23,240 --> 00:05:25,790 But I don't have any quotes in the database. 86 00:05:26,540 --> 00:05:31,760 And I did this intentionally to show you how to add a product if you don't have a product and you want 87 00:05:31,760 --> 00:05:33,800 to get it, so you try to get a product. 88 00:05:33,800 --> 00:05:36,860 So I'm going to click on skill and then I'm going to. 89 00:05:38,000 --> 00:05:42,290 Let's use the insert this time because I have already used this squirrel many years to insert. 90 00:05:42,860 --> 00:05:44,690 So the product idea is nothing because. 91 00:05:46,160 --> 00:05:51,800 Because as he told you, the product it will be returned to buy will be given by the database, the 92 00:05:51,800 --> 00:05:52,520 product name. 93 00:05:52,550 --> 00:05:56,930 I'm going to say here the black goods. 94 00:05:59,140 --> 00:06:04,720 Category codes because we said, here, return codes. 95 00:06:05,500 --> 00:06:07,730 So the cat category here must go. 96 00:06:07,790 --> 00:06:08,590 Must be courts. 97 00:06:09,910 --> 00:06:10,870 Product description. 98 00:06:11,710 --> 00:06:13,480 Black gods. 99 00:06:15,650 --> 00:06:20,240 For many, it's a product image. 100 00:06:20,300 --> 00:06:27,630 The first guy to have an image called Glass one got big. 101 00:06:28,220 --> 00:06:29,420 Again, this must. 102 00:06:30,560 --> 00:06:31,750 Claude's. 103 00:06:35,320 --> 00:06:37,270 Close one again. 104 00:06:37,270 --> 00:06:41,290 This must match the name of the image that you have in your project. 105 00:06:43,090 --> 00:06:45,280 The image, too, is just going to be clogs. 106 00:06:45,340 --> 00:06:47,470 Let me make sure that they have the image. 107 00:06:48,280 --> 00:06:49,480 So the image is. 108 00:06:51,240 --> 00:06:52,320 In the assets. 109 00:06:53,790 --> 00:06:54,480 Images. 110 00:06:56,850 --> 00:06:58,200 Glut one. 111 00:07:00,190 --> 00:07:01,060 Glance. 112 00:07:03,370 --> 00:07:03,790 One. 113 00:07:05,020 --> 00:07:05,560 So the image. 114 00:07:05,770 --> 00:07:11,080 Image two is going to be close one, three, like this one, because they don't have other images. 115 00:07:12,280 --> 00:07:16,060 And the price is, let's say, 150. 116 00:07:16,780 --> 00:07:19,210 The special offer is nothing zero. 117 00:07:20,080 --> 00:07:26,170 The product color, I'm going to say black and then I'm going to click on this should insert a new product. 118 00:07:26,170 --> 00:07:30,520 So now I'm going to get, as you can see right inserted. 119 00:07:30,520 --> 00:07:34,330 Let me now refresh and the error should I think should be gone. 120 00:07:34,330 --> 00:07:35,650 But we still have this error. 121 00:07:47,050 --> 00:07:53,290 And the reason for this area is because here I said where category I should actually say where product 122 00:07:53,980 --> 00:08:01,750 underscore category because remember the column it's very important to to check double check because 123 00:08:03,010 --> 00:08:05,260 usually you will make a mistake like this. 124 00:08:05,980 --> 00:08:08,410 So the column was not category. 125 00:08:08,590 --> 00:08:09,520 Not category. 126 00:08:10,090 --> 00:08:13,630 The the the column was product underscore category. 127 00:08:13,630 --> 00:08:20,920 So here it must be product underscore category category is equal to quotes. 128 00:08:21,400 --> 00:08:23,020 So the spelling is very important. 129 00:08:23,020 --> 00:08:25,120 If you get this wrong, it's not going to work. 130 00:08:25,120 --> 00:08:25,510 Let me. 131 00:08:26,650 --> 00:08:31,930 Click on file and then staple and let's make sure that it works. 132 00:08:33,250 --> 00:08:38,290 So as you can see now, it's going to return the product from the retail network successfully. 133 00:08:38,890 --> 00:08:41,650 And since we only have one now, it's going to return. 134 00:08:41,650 --> 00:08:43,630 One could let me prove that to you. 135 00:08:43,660 --> 00:08:46,960 So if I insert another quote quickly, lemme insert one quickly here. 136 00:08:47,620 --> 00:08:51,430 I'm going to see a blue, blue card. 137 00:08:52,420 --> 00:08:54,220 And then here I'm going to say cards. 138 00:08:55,090 --> 00:08:58,060 And then here I'm going to say blue cards. 139 00:08:58,990 --> 00:09:00,610 And here I'm going to say image. 140 00:09:02,200 --> 00:09:03,040 Clothes, too. 141 00:09:04,540 --> 00:09:05,080 And then. 142 00:09:06,430 --> 00:09:08,290 And lastly, clothes. 143 00:09:10,100 --> 00:09:10,490 Two. 144 00:09:11,060 --> 00:09:11,720 I'm here. 145 00:09:11,840 --> 00:09:16,400 Wants to add the price is 200. 146 00:09:17,560 --> 00:09:18,550 Special offer? 147 00:09:18,550 --> 00:09:19,080 Nothing. 148 00:09:19,090 --> 00:09:23,170 And then I'm going to click on Go and this is going to insert a new product. 149 00:09:24,010 --> 00:09:26,830 So we have a new product leading a refresh and prove that to you. 150 00:09:26,830 --> 00:09:29,800 So if I refresh, we should get here a new product. 151 00:09:29,800 --> 00:09:30,790 So it works is for you. 152 00:09:31,270 --> 00:09:32,460 So this is how it works. 153 00:09:32,510 --> 00:09:39,130 This is how we can get products and insert products into the database and make sure, again, pay attention 154 00:09:39,130 --> 00:09:45,310 to these small mistakes that you could make, such as here product underscore category and the name 155 00:09:45,310 --> 00:09:47,140 of the image for the name of the image is critical. 156 00:09:47,140 --> 00:09:49,030 Otherwise you are not going to get the image.