So now what they need to do is that we need to work on this section.
So this section has these codes and we need to get the codes from the database.
So in my in order to get the courts, we need to create a new file here in the server called Get Underscore
Codes.
That impeachment and the code is going to be similar to the featured products, but there will be something
different and important as well.
So the difference is that the air we select all from from products limit for however we need to say
here where we're.
And then we need to add a condition.
So we don't want to get all products.
We need to get only goods.
So we need to say where category?
Category.
Category category is equal to.
Category is equal to.
Its.
But so we need to say category is equal to God.
So this is very important.
And we are good to go.
That's it.
We need to limit the four limit to four, because we have only here for we can only display here four.
And finally, we need to say here quotes products.
Courts.
That's it.
Very, very simple.
Now, in the index, we need to look for the records.
I think Big Lots has records.
So we have the addresses and codes we need to to do the same way as we did with the with the featured
products.
We need to remove all products and keep only one.
So what I'm going to do is that.
I'm going to keep this product and remove the other for the other three.
So I'm going to remove this and this.
And this.
So we should have now only one product.
So I'm going to add to your space.
I'm going to have your space to show you that this is a product.
Let me say.
Now let me make sure that I my credit is not broken, so my code is fine.
So we have only one product.
Now we need to include here.
We need to say B2B and then include.
Include.
And we need to include.
What do we need to include?
We need to include the.
Server four slash get cuts.
And we need to do the same.
We need to add a little prep each week and then while for.
While only upping the ante clearly bracket and the you're in the classic yearly bracket at the bottom
each week and then clearly bracket while raw, is equal to Y or is equal to the.
Remember, the name of the variable is gots products.
What's.
Products.
And then I'm going to call a function called Fetch a source.
That's it.
Now we need to replace this with the the image.
First, I'm going to say here BHP.
And then echo.
And we need to echo the roar.
Product image.
Right act, underscore image and then cynical.
For the for the name we need to say.
Reach me again and then echo raw product.
Name.
Rice.
BHP.
Erica.
Fried rice.
That's it's pretty simple.
Let me save and let me refresh and show you how this is going to look like.
By the way, I will get nothing and I'm going to explain why I'm going to get nothing.
Let me refresh.
And if I get nothing, as you can see, I got nothing.
Even I got an error.
I have here an error on line eight.
Here it says on code error call to remember boolean or.
Yes, this error is because I got nothing.
Why did I get nothing?
Because I don't have any quotes in the database.
I hear I'm telling my database.
Hey, my database.
I want you to return me all codes from.
From the factories.
But I don't have any quotes in the database.
And I did this intentionally to show you how to add a product if you don't have a product and you want
to get it, so you try to get a product.
So I'm going to click on skill and then I'm going to.
Let's use the insert this time because I have already used this squirrel many years to insert.
So the product idea is nothing because.
Because as he told you, the product it will be returned to buy will be given by the database, the
product name.
I'm going to say here the black goods.
Category codes because we said, here, return codes.
So the cat category here must go.
Must be courts.
Product description.
Black gods.
For many, it's a product image.
The first guy to have an image called Glass one got big.
Again, this must.
Claude's.
Close one again.
This must match the name of the image that you have in your project.
The image, too, is just going to be clogs.
Let me make sure that they have the image.
So the image is.
In the assets.
Images.
Glut one.
Glance.
One.
So the image.
Image two is going to be close one, three, like this one, because they don't have other images.
And the price is, let's say, 150.
The special offer is nothing zero.
The product color, I'm going to say black and then I'm going to click on this should insert a new product.
So now I'm going to get, as you can see right inserted.
Let me now refresh and the error should I think should be gone.
But we still have this error.
And the reason for this area is because here I said where category I should actually say where product
underscore category because remember the column it's very important to to check double check because
usually you will make a mistake like this.
So the column was not category.
Not category.
The the the column was product underscore category.
So here it must be product underscore category category is equal to quotes.
So the spelling is very important.
If you get this wrong, it's not going to work.
Let me.
Click on file and then staple and let's make sure that it works.
So as you can see now, it's going to return the product from the retail network successfully.
And since we only have one now, it's going to return.
One could let me prove that to you.
So if I insert another quote quickly, lemme insert one quickly here.
I'm going to see a blue, blue card.
And then here I'm going to say cards.
And then here I'm going to say blue cards.
And here I'm going to say image.
Clothes, too.
And then.
And lastly, clothes.
Two.
I'm here.
Wants to add the price is 200.
Special offer?
Nothing.
And then I'm going to click on Go and this is going to insert a new product.
So we have a new product leading a refresh and prove that to you.
So if I refresh, we should get here a new product.
So it works is for you.
So this is how it works.
This is how we can get products and insert products into the database and make sure, again, pay attention
to these small mistakes that you could make, such as here product underscore category and the name
of the image for the name of the image is critical.
Otherwise you are not going to get the image.