So now what we need to do is that we need to get the order in as it all you hear after we insert this
order into the database.
The database in return will issue a new order.
And we need to get this order in because we will need to use this order ID in order to place each single
element in each single product in the ordered items, because otherwise we wouldn't know which products
the user wants to do to buy because after the user, for example, if the user adds these items, we
will not.
Even if we add an order in the order table, this order will only have we only store user information
as well as the order ID.
But in order to know the order details about that order, we need to store these two or however many
number of items that the user wants in the order items.
Therefore, we need to get the we need to get the order ID from the database.
So to get the order either after it has been inserted, after the order has been inserted, the database,
if you call the is the empty and call a function called insert the database.
After you call insert I.D., the database is going to return the order I order underscore item and I'm
going to prove it to you now.
Now, let me hear say echo and then I'm going to display the order.
It is just for the sake of this thing.
I'm going to say order I.D. By the way, in the check out, we need to say here, action.
And then we need to remove this and we need to say server first server or slash place order because
the check out page is outside the server, whereas the police order that HP is inside the server.
So in order to get to the place order file we need to say server four slash place order that Beechwood
and here in the place order we just get the we just insert the order and the database will return the
order ID and now we just need to do the display, the order ID just for the sake of this thing.
So let me click on file on the table and let's this.
So now suppose that I am a customer and let me remove everything from the card.
And suppose that I'm now a customer.
So I'm going to go to the homepage.
I'm going to go to the homepage.
And then let me, for example, say that they want to buy this item.
I'm going to click on Buy now and then I'm going to click on Add to Cart, and then I'm going to click
on checkout.
So if I click on checkout, it's going to ask me to fill out this form.
So let me fill out this form quickly.
So I have filled this this form quickly and let me click on Place Order.
Again, you will not be able to click on Please Order unless you fill the complete the complete form.
So if you don't feel if you forget to fill one of these, it's not going to work.
So, for example, if you say if you click on place order, it's not going to work.
It's going to tell you, please fill out the form.
So let me click on Place Order.
If I click on Place Order, guess what it's going to display here.
Here, as you can see, it's going to say one.
What does this one mean?
This one means that the order has been inserted into the database.
Let me show you this.
Now, in the orders table, if I refresh the order table, a new order has been placed, as you can
see, and your order has been placed within my information.
So order it is one order.
Cost is 155 order status is on hold because I didn't pay and the order has just been placed.
The user ID is one by default.
The user ID phone number, the city, the address, everything has been stored in the into the database.
So this is how it works.
And now we make sure that the order ID will be returned by the database.
Now we can move on and continue with the other steps.