Answer the question
In order to leave comments, you need to log in
How to display data from the database on the page?
When an authorized user makes an order on the site, the order data (id, id_user, name, price, data, status) is added to the database. How to display this data in the user's personal account?
Answer the question
In order to leave comments, you need to log in
make a request to the database, get the desired record, and display it on the page using html markup (or use some kind of Twig template engine)
The problem is probably to understand how exactly to display the record the user needs?
You can redirect it to the page site.ru/order/order
id and get a record from the url by the order id.
Or save the order ID in cookies. and carry through it
Display a list with the history of orders
On each of them, make a link like
/order/42
When you go to the order page, pull out the desired order
select * from orders where user_id=123
select * from orders where order_id=42 AND user_id=123
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question