I would like to know how to make each order made by a certain user have their order history and not share, for example:
The autoincrementing of other users, that is, if a user x makes 10 orders, it is not shown to the other user who has created an order, the id starts at 11, since those spaces were already filled by another user.
I don't know if I'm explaining myself, this is more theory since I don't understand how to do it, I mean by request when a customer buys several products, then I create an order line and it is saved in the table, but here is the problem, that another user can arrive and create, for example: 5 orders and another user x when he wants to create one more order, he would be starting the id at 6 since the 5 spaces were occupied, I want to avoid that and start at 1, because they are stored in a a single table of all the order lines of all users, it would be greatly appreciated if you could explain the logic to avoid this.
Mainly it is a database question of how to avoid this.
(But I develop it with php)
(I also understand that this question does not meet the requirements to be published, since it can be long) but I would really like to know how to do this. (Srry if it is a lot of text, try to detail it as much as I could, so that it is understood)
you can count the user requests just before creating a new one, there is no way to solve that with an autoincrement