So now in the edit product page, this page, we need to activate this form and we also need to get
the product information first and display the old information, the all the details here.
So to get the old details, we can make a query or pass.
Pass the old query, pass the old data from here.
We can pass the old data from here or we can make a new query from this page.
So let's create a new query here because it's easy.
I think it's not going to take any time.
You can then use a BGP and then remember the code is here.
You can copy the code from here.
This could.
And then they sit here and I'm just going to say a statement, one statement, one statement, not even
one.
And then I'm going to say select, select all from products where where product underscore ID is equal
to the product ID.
So the product ID, we got the product ID from the page from the get request.
I'm going to say here, if we have the get.
Yet, then I'm going to say product.
Their score.
If we have this, we can now add this code inside.
Else.
We can't say either.
And then products that HP and then exit.
And here prepare, prepare, select oil from products where the idea is equal is equal to the product
idea.
So I'm going to create a variable here.
Product I need is equal to get.
80.
And then we pass here the product lady or we add a question mark, and then in a new line we can say
statement bind Sara, bind Bahram and then we bind the S, the I, the product ID and then comma product.
And then he don't forget to say statement.
Get results.
Pretty simple.
Lastly, we need to say here, products, not products, product singular.
And then in the bottom, we need to display the old information about all product information.
So instead of displaying in the fields with the values here, the title is going to be here value and
the value is going to be equal to each B and then product.
Then we need to copy this card, this value and paste it in every single field we have.
We have here the product description, description.
And then we have the product price.
Well elect.
Right.
And then we have a category.
The category.
A is going to be here.
This is a little tricky, but I'm going to work on it later.
And then the color I'm going to say your valley.
I'm going to say your product, product, color.
And then for the special offer, I'm going to say product, special offer.
And then added Barron, It's just going to be Ed Baron.
We don't have to do anything.
Lastly, we need to add two things.
First, we need to say Echo, and then we need to hear.
Also say Echo, and here we need to say Echo, and here we need to say echo.
And here as well.
Echo.
And lastly, we need to add a loop, because even though this is not a this this is NRA.
Only one of only one of only one object.
Of only one object.
Therefore, we need to add a loop here.
So I'm going to say here for each or each.
First we need to each be.
For each.
Right acts.
As.
Let's say pride acts as.
Product.
And then I then clearly bracket and then BHP and then we close it at the end, we close it here.
We close it here?
However, we need to edit something very important.
When we need to edit something very important, which is the name of the variable.
So the name of the variable at the top it should be products.
Now, even though it's, it's, it's one product, I'm going to get only one product.
But here I'm going to say products because it's going to be an array.
This is going to return an array.
ZELENY I'll save the other over to the browser to test.
So now in the browser, let me refresh.
I'll click on edit and if you click on it, it's going to display the old information.
So you're just going to play the details of the product.
Actually, here it should say product.
I shouldn't be saying it.
I should say product name here, product name.
So let me refresh one more.
Let me go and refresh one more time.
Now.
I couldn't get the old information.
If I click on edit, I'm going to give you all information here.
Giving back.
Awesome.
Giving back 155 bags wide.
And that special offers you the next thing.
That thing that we need to do is that we need to activate this edit button so that the user will be
able or the admin will be able to edit information regarding this product.