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
and failure messages.
So here I'm going to say F is set if a set.
And then get, get.
Edit.
Success, massive thing.
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
then Echo and then I'm going to echo the message.
I'm going to see Echo edit.
Success.
Message.
And I'm going to adhere to this message.
I'm going to have the class take center.
Take centre and colour, so the colour is going to be green.
I'm going to say style colour green and then I'm going to close the BHP here.
Got BHP Caitlyn bracket and then close this.
And in case of failure, in case we have an error and we want to display an error, I'm going to copy
the same code again.
I'm going to base it below, but I'm going to change here.
I'm going to say I'm going to change the key.
I'm going to say edit failure message, failure message.
And here I'm going to also say edit failure message and the colour is going to be red.
Now back to the edit product.
Now in the edit product, we we need to say if, if statement execute, if it's true, then we need
we need to say, hey there, we need to copy this and then paste it inside.
And then we need to say products and then it.
Success message event is equal to product has been.
I'm Nathan.
Successfully.
In case of a failure, I'm going to say else they don't get a copy.
I'm going to believe this and I'm going to copy the same exact line.
This line, however, the key is going to be different.
The request is going to be a red failure message.
Failure message.
And then I'm going to say error occurred.
Error occurred.
Try again.
Try.
Again.
And lastly, we need to we need to fix three things actually here in this statement.
Update Product set, product name, product description.
Here I have a problem.
I forgot to say here product price is equal to question mark.
Also here, product offer.
It should be product special.
A special offer because in the database its project underscore special underscore offer.
So this this this is a big problem.
Another thing that they want to fix is here, I should say actually, I should you say is set a set
get project ID.
Similarly in the else I'm going to say is set.
Is said past a edit button.
And the last thing that I want to fix is the product.
The product idea.
Since since I'm going to make the request on the same page, the product idea is going to be null.
Therefore, we need to store it in the form, in a hidden in here, in a hidden field.
I'm going to say input.
And then I'm going to say your name is equal to product underscore ID and the value is equal to.
BHP Echo.
Project.
Product.
Product I.D..
And lastly, we need to give a name to this.
To this input.
We need to say we need to give it another name.
We need to give it a type.
Type so the type would be hidden.
It should be hidden.
So we have a tape, we have a name and we have a value.
Add it up.
We need to get the product ID, I'm going to say here, product I.D. So the product ID is going to be
now equal to past.
And then product.
Product I.D..
And he reposted the product.
And I.
And don't forget the semicolon.
Now, it should.
Everything should be perfect.
Let me save everything.
Let's say then over to the browser to test.
So now in the browser, let me refresh first.
Let me edit a product.
For example, in the end of the first product, I'm going to click on edit.
Now let me here, for example, say yellow instead of white, I'm going to say yellow shoots.
If I click on edit.
As you can see, it's as a product has been updated successfully and he uses yellow shoots and you can
edit of course the price me it at the price I'm going to say 155.
I'm going to say 195.5.
And you can either be category, let me say shoes and you can edit the color.
The color you can say yellow.
And the offer could be anything, let's say 50% off.
And then if they click on it, it.
Or I should say, by the way, he.
I should.
This should be.
Here.
It says, let me type it one more time.
And it should.
It should.
I think it should be.
It should be.
It should be a number, not a not a decimal.
So we need to fix this.
I'm going to be fixing this because now if I click on edit, it's not going to work because this allows
only numbers.
And to fix this we can simply change.
Change the the type the type of the price to to text.
Simple text.
So this should be a text.
And for now, I'm just going to pass a real number, a complete number on it says 155.
Yellow shoes.
Let me now try with the new with this field.
So if I say one 95.5 and click on edit, it will be one one, 95.1 95.5.
So it works successfully.